Jump to content

  • Log In with Google      Sign In   
  • Create Account

We're offering banner ads on our site from just $5!

1. Details HERE. 2. GDNet+ Subscriptions HERE. 3. Ad upload HERE.


#ActualBitMaster

Posted 02 April 2013 - 05:12 AM

So in the case of ",".split(","), we have one matching substring, ",". And there are two substrings that are either terminated by a matching substring or end of the string, "" and "". So, something is false here? Or am I understanding it wrong? Where does it say that a substring can't have a length of 0?

Further along in the documentation it states

If n is zero then the pattern will be applied as many times as possible, the array can have any length, and trailing empty strings will be discarded.

";" would be split into "" and "", but both are trailing empty strings and discarded before the method returns.

#1BitMaster

Posted 02 April 2013 - 05:11 AM

So in the case of ",".split(","), we have one matching substring, ",". And there are two substrings that are either terminated by a matching substring or end of the string, "" and "". So, something is false here? Or am I understanding it wrong? Where does it say that a substring can't have a length of 0?

Further along in the documentation it states

If n is zero then the pattern will be applied as many times as possible, the array can have any length, and trailing empty strings will be discarded.


PARTNERS