[Gambas-user] Another possible change...

Benoit Minisini gambas at ...1...
Sun Dec 14 21:47:07 CET 2003


On Sunday 14 December 2003 18:18, Nelson Ferraz wrote:
> 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:

Huuu ? String has no methods, it is a native datype.

>
> newString = myString.Reverse()
>
> Using Split and Join methods, we could reverse a sentence word by word:
>
> newString = myString.Split(/\s/).Reverse().Join(' ')
>
> The Reverse() method should be applicable to arrays as well.

OK ! You want a Array.Reverse()... I will dit it. But what is the use of 
reversing a sentence word by word ? 

Regards,

-- 
Benoit Minisini
mailto:gambas at ...1...





More information about the User mailing list