I have this code:
String string = "_a_b___";
String[] parts = string.split("_");
The result is that variable parts has only three elements
parts[0] = ""
parts[1] = "a"
parts[2] = "b"
This is weird, because there are five "_" chars, so after splitting there should be six elements, not only three of them.
I want
parts[0] = ""
parts[1] = "a"
parts[2] = "b"
parts[3] = ""
parts[4] = ""
parts[5] = ""
How to do that? Thank you very much!