Printing unicode code to console using int intead \ uNNNN
apologies if this is stupid. How can I print a unicode character, say \ u20ac, using an integer? So, instead Console.WriteLine("\u20ac");
, I would like to pass the integer 8364. Thanks.
+2
Dervin Thunk
source
to share
1 answer
Just enter a number char
that represents the UTF-16 code point:
public static void PrintChar(int codePoint)
{
Console.WriteLine((char) codePoint);
}
PrintChar(8364);
+3
Jon Skeet
source
to share