Question: Why am I receiving a length of 3 instead of 4? How can I fix this to give the proper length?

```
String s="+9851452;;FERRARI;;";
String split[]=s.split("[;]");
System.out.println(split.length);

```

Answer: 
The answer for WHY it's not working is in the doc: <http://docs.oracle.com/javase/1.5.0/docs/api/java/lang/String.html#split%28java.lang.String%29> . "Trailing empty strings are therefore not included in the resulting array.".
You can use StringUtils from apache commons lang.

```
String s="+9851452;;FERRARI;;";
Arrays.toString(StringUtils.splitPreserveAllTokens(s, ";"))

```