SuperThomasLab SuperThomasLab - 1 year ago 177
Java Question

Java convert String to Unicode character. "U+1F600" = 😀

Please note that this question is not a duplicate.

I have a String like this:

// My String
String myString = "U+1F600";

// A method to convert the String to a real character
String unicodeCharacter = convertStringToUnicode(myString);

// Then this should print:

Answer Source

is this what you are looking for??



public static void main(String[] args) {
String myString = "U+1F600";
System.out.print(Character.toChars(Integer.parseInt(myString.substring(2), 16)));
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download