
Signature
Chris "the void permeates us all" Dollin
Hewlett-Packard Limited Cain Road, Bracknell, registered no:
registered office: Berks RG12 1HN 690597 England
> > Hi I don't understand this output:
>
[quoted text clipped - 12 lines]
> There's an empty string between the two `o`s of `boo`, ditto `foo`,
> isn't there?
sorry which string? I don't see it!
Nigel Wade - 26 Jun 2007 14:21 GMT
>> > Hi I don't understand this output:
>>
[quoted text clipped - 14 lines]
>
> sorry which string? I don't see it!
That's because it isn't there. How can you see it if it isn't there?
"o" is the delimiter. Your original string is:
b[delimiter][delimiter]:and:f[delimiter][delimiter]
remove the [delimiter]s and you are left with:
"b", "", ":and:f, "" and "".
The first string is what appears before the first delimiter. The second string
is what appears between the first and second delimiter i.e. nothing. The third
string is between the 2nd and 3rd delimiters. The 4th string is between the 3rd
and 4th delimiters, again nothing. The final string is what appears after the
final delimiter, nothing.
"I saw a string that wasn't there,
It wasn't there again today
O how I wish that string would go away"

Signature
Nigel Wade, System Administrator, Space Plasma Physics Group,
University of Leicester, Leicester, LE1 7RH, UK
E-mail : nmw@ion.le.ac.uk
Phone : +44 (0)116 2523548, Fax : +44 (0)116 2523555
Philipp Leitner - 26 Jun 2007 22:19 GMT
> > There's an empty string between the two `o`s of `boo`, ditto `foo`,
> > isn't there?
>
> sorry which string? I don't see it!
:) Thats kind of the point of an empty string, isn't it?
Do understand whats happening just look at your String again:
"boo:and:foo"
Your separator is 'o', therefore everything between two 'o's becomes a
string in your result array. Considering this it is obvious that 'oo'
will always yield an empty string, since there is nothing (i.e. an
empty string) between these two 'o's ...