Given following string:
String s ="12/15|22:58:25|B|99.502||||A|100.501|||||";
I am calling
int len = s.split("\\|").length;
Anyway length is 9, not 13 as it should be.
Nevertheless, if I modify said string in this way:
String s ="12/15|22:58:25|B|99.502||||A|100.501|||lol||";
Length is 13! How come?It just seems that java makes some kind of optimization, which is not required as those parts of string could be populated in some other context...