StringArray::fromTokens bug?



I'm trying to split a string to an array using StringArray::fromTokens().

Here is the string:

1.1||2013-04-02 02:54:41||- First release - Bugs correction||48904||114

Here is how I do it:

StringArray strArray = StringArray::fromTokens(resStr, "||", "");

Instead of having 5 entries delimited by ||, the result is an array of 9 elements.
Between each element I have an additional element which is a space character (while my original string does not contain these spaces)

Any idea ?



You're misunderstanding the meaning of the argument:

        @param breakCharacters      a string of characters, any of which will be considered
                                    to be a token delimiter.

It's not a string, it's a sequence of single break characters.


Got it !
Thanks Jules.