[Gambas-user] Another possible change...
Fabien Bodard
Gambasfr at ...11...
Sun Dec 14 21:38:27 CET 2003
Le Dimanche 14 Décembre 2003 18:18, Nelson Ferraz a écrit :
> Daniel Campos wrote:
> > Is there any function to reverse the contents of an string?
> >
> > I mean :
> >
> > String A
> > String B
> > A="hello"
> > B=StrReverse(A)
> > B="olleh"
>
> It's another interesting idea, but I think it could be implement as a
> string method:
>
> newString = myString.Reverse()
>
> Using Split and Join methods, we could reverse a sentence word by word:
>
> newString = myString.Split(/\s/).Reverse().Join(' ')
Hummm ... I don't really understand this line... Do i must understand dots as
Pipe ?
Fabien
>
> The Reverse() method should be applicable to arrays as well.
More information about the User
mailing list