Convert hexadecimal unicode character into its visual representation

Viewed 5781

I am trying to make a C# program that translates unicode character from its hexadecimal format to a single character, and I have a problem. This is my code:

This works:

char e = Convert.ToChar("\u0066"); 

However, this doesn't work:

Console.WriteLine("enter unicode format character (for example \\u0066)");
string s = Console.ReadLine();
Console.WriteLine("you entered (for example f)");
char c = Convert.ToChar(s); 

Because (Convert.ToChar("\\u0066")) gives the error:

String must be exactly one character long

Anyone have an idea how to do this?

2 Answers
Related