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
Post a Comment