I\'m reading from a .csv File line by line. One line could look for example as following: String str = \"10,1,,,,\".
String str = \"10,1,,,,\"
Now I would like to split according to
split only drops trailing delimeters by default. You can turn this off with
String str = "9,,,1,,"; String[] parts = str.split(",", -1); System.out.println(Arrays.toString(parts));
prints
[9, , , 1, , ]