Java difference between "split(regEx)" and "split(regEx, 0)"? -



Java difference between "split(regEx)" and "split(regEx, 0)"? -

is there difference between using split(regex) , split(regex, 0)?

because output cases tested same. ex:

string mys = stack overflow; string[] mysa = mys.split(' ');

results in mysa === {'this','is','stack,'overflow'}

and

string mys = stack overflow; string[] mysa = mys.split(' ', 0);

also results in mysa === {'this','is','stack,'overflow'}

is there "hidden" going on here? or else needs known .split(regex, 0)?

they same.

quoted string.split(string regex) documentation:

this method works if invoking two-argument split method given look , limit argument of zero. trailing empty strings hence not included in resulting array.

java split

Comments

Popular posts from this blog

Using Android Volley to post an array to PHP -

python - How to add an model instance to a django queryset? -

angularjs - No 'Access-Control-Allow-Origin' error from local domain to public API -