Int to Char in C#

Boaz picture Boaz · Nov 14, 2008 · Viewed 276.3k times · Source

What is the best way to convert an Int value to the corresponding Char in Utf16, given that the Int is in the range of valid values?

Answer

gimel picture gimel · Nov 14, 2008
(char)myint;

for example:

Console.WriteLine("(char)122 is {0}", (char)122);

yields:

(char)122 is z