"name:john;;sex:m;;".split(";");
it's like
name:john;"";sex:m;"";
so it should contain 4 elements
About Question com.enthuware.ets.scjp.v6.2.125 :
Moderator: admin
-
- Posts: 5
- Joined: Sat Mar 23, 2013 4:05 am
- Contact:
-
- Site Admin
- Posts: 10386
- Joined: Fri Sep 10, 2010 9:26 pm
- Contact:
Re: About Question com.enthuware.ets.scjp.v6.2.125 :
Did you read the description of the split method given with the question? It clearly says, "trailing empty strings will be discarded".
HTH,
Paul.
HTH,
Paul.
Who is online
Users browsing this forum: No registered users and 9 guests