I'm trying to convert a string into an array using the split(";")
.
I do so:
String str = "ggg;123;q;w;;";
String[] strArr = str.split(";");
Returns array:
["ggg","123","q","w"]
But I want to be returned:
["ggg","123","q","w","",""]
Strings may be "ggg;123;;w;;df"
or "ggg;123;;;ds;"
.
I want to create an empty element in the array when there is no value between ";". This is possible to do?
Thanks for the help!