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

java - How to set log4j.defaultInitOverride property to false in jboss server 6 -

c - GStreamer 1.0 1.4.5 RTSP Example Server sends 503 Service unavailable -

Using ajax with sonata admin list view pagination -