I have string which contains null character ie \0
. How can I print the whole string in java?
String s = new String("abc\u0000def");
System.out.println(s.length());
System.out.println(s);
Output on eclipse console:
7
abc
Length is that of complete string, but how can I print the whole string?
UPDATE: I am using
Eclipse Helios Service Release 2
Java 1.6