Imagine you have:
String string = "A;B;;D";
String[] split = string.split(";");
I want the result to be:
split[0] = "A";
split[1] = "B";
split[2] = "";
split[3] = "D";
But the result is:
split[0] = "A";
split[1] = "B";
split[2] = "D";
Is there a simple PROPER way to to this?
Use the overloaded method
split(String regex, int limit):From the documentation: