get the unicode of a character in c#
-
i'm trying to get the unicode value of a character when the character is given , for example, i can get the character using
string s = '\u0061';
so the character is assigned to s , but now i want the vise versa , means i want to get the unicode of the s , the result should be '\u0061'.any one gat an idea . thanx in advance.
-
i'm trying to get the unicode value of a character when the character is given , for example, i can get the character using
string s = '\u0061';
so the character is assigned to s , but now i want the vise versa , means i want to get the unicode of the s , the result should be '\u0061'.any one gat an idea . thanx in advance.
Not tested:
string unicode = string.Format("'\\u{0:X4}'", (int)s[0]);
-
Not tested:
string unicode = string.Format("'\\u{0:X4}'", (int)s[0]);
thanx it works for me thax again.