Getting unicode string from its code - C#

后端 未结 3 798
梦谈多话
梦谈多话 2020-12-13 13:04

I know following is the way to use unicode in C#

string unicodeString = \"\\u0D15\";

In my situation, I will not get the character code (

3条回答
  •  無奈伤痛
    2020-12-13 13:33

    You want to use the char.ConvertFromUtf32 function.

    string codePoint = "0D15";
    
    int code = int.Parse(codePoint, System.Globalization.NumberStyles.HexNumber);
    string unicodeString = char.ConvertFromUtf32(code);
    // unicodeString = "ക"
    

提交回复
热议问题