SyntaxFix
Write A Post
Hire A Developer
Questions
You can simply write:
char c = (char) 2;
or
char c = Convert.ToChar(2);
or more complex option for ASCII encoding only
char[] characters = System.Text.Encoding.ASCII.GetChars(new byte[]{2}); char c = characters[0];