There is a 16-bit representation of a number, like using System.out.println('\uXXXX'); show the characters, if these same XXXX constantly changing? or if you come from the other side, let ХХХХ act as the result of a certain function, what can you do?
- What is your idea of this? do you want to withdraw without \ u? - Victor
- @Victor in String, well, without \ u I’m unlikely to get a character from the Unicode table, so with him - Arkady
- then it is not clear what the problem is? If we put "\ u0B08" in the String, then at the output we get "ଈ" - Victor
- @ Victor, the problem is that I only have 0B08 in String, without \ u, this is the whole hitch, and it’s impossible to divide \ u without XXXX - Arkady
- Is there a single character code in the string? If several then they are glued or separated? - Victor
|
2 answers
The class Integer has a method Integer.parseInt (String s, int radix)
With it, you can translate a string into a number, if you know the number system.
String number = "E7C7"; char E7C7 = (char)Integer.parseInt(number, 16); System.out.println(E7C7); The screen will display
- thank you so much) - Arkady
|
String s = "\uXXXX"; char s1 = s.toCharArray()[0]; |