Creating Unicode character from its number

后端 未结 13 1822
挽巷
挽巷 2020-11-28 21:38

I want to display a Unicode character in Java. If I do this, it works just fine:

String symbol = \"\\u2202\";

symbol is equal to \"∂\". That\'

13条回答
  •  再見小時候
    2020-11-28 22:23

    This one worked fine for me.

      String cc2 = "2202";
      String text2 = String.valueOf(Character.toChars(Integer.parseInt(cc2, 16)));
    

    Now text2 will have ∂.

提交回复
热议问题