[Gambas-user] bug in function split?

ron ronstk at ...239...
Tue Apr 6 20:15:49 CEST 2004


On Tuesday 06 April 2004 19:55, Frank Berg wrote:
> hi ron, tnx for the answere but...
>
> > If the comma is the default and in all your examples is no comma.
> > Then you should have a array of only 1 argument, the whole string.
> > for the last two
>
> sorry ... my mistake.. ofcourse are the split command ," ")  importen in my
> question..
> and in all 3 split demos i will say : s=split("demo formattet
> string",chr(32))   :-)
>
> that what i will say is that the split command is to split an formattet
> string back to the words..
>
> frank++++berg++++++flensburg
> benoit+++minisini+++++world
>
> so, in bouth strings are 3 formatted words and the split command in VB will
> return the 3 words back.. and no split character or empty arrays
>
> gambas come back with an split_character_count-1 of empty array elements.
>
> maybe it is in mathematik correct as it is, but it is not the correct way
> to split an formattet string?? or is it???
>
> frank
>

Strict I think it is correct as is. The separator in your example is a space
so for occurring a space a new entry in the array is made.
You can after the split walk trough the array and delete the empty ones.

May be a WISH: to have a option flag in the split to do that automatic is not 
so bad idea. In my imagination to use a split for words looks nice.

Ron




More information about the User mailing list