Suppose I have a binary file that has this content:
abc\0def\0ghi\0
The content is already read and stored in a string variable s. How should I extract the components “abc”, “def”, “ghi” into different string tokens? The usual methods such as split, stringTokenizer do not accept \0 as delimiter.
\0is the null character, so you can use its unicode representation as a delimiter.However, you can use just “\0” as the delimiter to split on.