[Gambas-user] Opposite of Split

Eilert eilert-sprachen at ...221...
Thu Jun 16 17:50:05 CEST 2005


Aaah - that's why I remembered to have seen something like that before :-)

Rob schrieb:
> On Thursday 16 June 2005 10:29, Eilert wrote:
> 
>>is there an opposite of the Split function? Something like "join"
>>or so that can put together the contents of an array into a string,
>>separated by any separator?
> 
> 
> Yes, there is a Join(), but it's a method of the array class, not a 
> function per se.
> 
> dim x as string
> dim a as string[]
> 
> x = "a,b,c,d,e"
> a = split(x, ",")
> print a.join("/")
> 
> Output should be:
> a/b/c/d/e

So it should be possible to do

x = a.join("/")

Yes, I tried it, it runs just the way I imagined.

Thanks
Rolf





More information about the User mailing list