如何在c#win中将Unicode编号转换为字符串。形成 [英] How to convert Unicode number to string in c# win. form
本文介绍了如何在c#win中将Unicode编号转换为字符串。形成的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个unicode号码 U + 2602
,如何将其转换为特定符号或字符串,然后再将其转换回unicode号码? 以上unicode号码的符号是: - (请参阅下面的链接)
https://www.dropbox.com/s/9n8v8rs383he7e3/Unicode%20answer.png [ ^ ]
I have a unicode number "U+2602
", how to convert it into it's particular symbol or charachter and then again convert it back to unicode number? Symbol of the above unicode number is :- (Please see in the link below)
https://www.dropbox.com/s/9n8v8rs383he7e3/Unicode%20answer.png[^]
推荐答案
char myValue = Char.Parse("\u2602");
转换回字符串
convert back to string
string str = string.Format(@"\u{0:x4}", (int)myValue);
if你需要字符串
if you need string
string myValue = Char.Parse("\u2602").ToString();
这篇关于如何在c#win中将Unicode编号转换为字符串。形成的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文