Unicode码转汉字

记录工作需要:将Unicode码转为汉字

string a = @"\u80a1\u7968";
var list = a.Split(@"\u");
for (int i = 1; i < list.Length; i++)
{
   var s = int.Parse(list[i], NumberStyles.HexNumber);// 解码为数字
   var tt = (char)s;// 转为汉字
   Console.WriteLine(tt); 
}    

 

posted @ 2021-03-29 14:50  李大飞  阅读(323)  评论(0编辑  收藏  举报