Page 1 of 1

About Question com.enthuware.ets.scjp.v6.2.125 :

Posted: Sat Mar 23, 2013 4:36 am
by Amol Khopkar
"name:john;;sex:m;;".split(";");
it's like
name:john;"";sex:m;"";
so it should contain 4 elements

Re: About Question com.enthuware.ets.scjp.v6.2.125 :

Posted: Sat Mar 23, 2013 6:54 am
by admin
Did you read the description of the split method given with the question? It clearly says, "trailing empty strings will be discarded".

HTH,
Paul.