Possible Duplicate:
Java split() method strips empty strings at the end?
In Java, I'm using the String split method to split a string containing values separated by semicolons.
Currently, I have the following line that works in 99% of all cases.
String[] fields = optionsTxt.split(";");
When using following String everything is perfect:
"House;Car;Street;Place" => [House] [Car] [Street] [Place]
But when i use following String, split Method ignores the last two semicolons.
"House;Car;;" => [House][Car]
What's wrong? Or is there any workaround?