I use String.split() to split the string. The line that I get has the following structure:
[data]<US>[data]<US>
where <US> is the ASCII unit separator (code 0x1F). Split code
String[] fields = someString.split(String.valueOf(0x1f));
This works fine if [DATA] not an empty string. In this case, the data is simply skipped.
I want a string like [DATA]<US><US>[DATA]<US> return an array with three elements: [DATA] , null and [DATA] .
How can i do this?
source share