I am trying to split the Value using a separator. But I am finding the surprising results
String data = \"5|6|7||8|9||\";
String[] split = data.split(\"\\\\|
From String.split() API Doc:
Splits this string around matches of the given regular expression. This method works as if by invoking the two-argument split method with the given expression and a limit argument of zero. Trailing empty strings are therefore not included in the resulting array.
Overloaded String.split(regex, int) is more appropriate for your case.