Say I have a String s = "50";, and I want to append "\u00" onto the front of the string.
Is this possible without throwing an Illegal unicode escape?
Thanks.
In java, unicode escapes must be four digit. Use \u0000 Also String s = 50is invalid. Use String s = "50"
If you want the final result to be "\u0050", you have to realize that escapes only really exist at the source level. You'd have to do something like this to "append" the unicode modifier to the beginning of a String containing a number
s = new String(Character.toChars(Integer.parseInt(s,16));//16 because unicode is hex
String s = 50would not compile.String s = "50";? Pls check your question after you have posted.