posted 4 years ago
Actually what happens when splitting If you split using then the result is .
When is split using the result is . In first occurrence of "o" the string is split between "b" and "o:and:foo" then when "o" is encountered for the second time "b" and "o:and:foo" is built into {b", "", ":and:foo} .
Why does an empty string gets constructed?