Greg Charles wrote:It's confusing because it's weird to think of digits as delimiters. Imagine the string was "x,,,, y,, z, a" and you split it on the commas. You'd expect to get eight strings returned, many of which would be empty because there are multiple commas in a row with nothing between them.
yes it is confusing!
but let me take this a step further.
If the string was "x,y" and I split on commas, I would expect 2 strings to be returned: "x" and "y"
If the string was "x,,y" and I split on commas, then this is where I get confused....it sees the first comma, and marks "x" as the first token. Does it then consider the "x" and first "," as 'consumed'? thus, when it sees the second comma, there is nothing to the left of it to tokenize, so it returns a blank? I am confused here,,,,