char
suggest changeA char is a UTF-16 code unit, often a single character, stored in a variable. It is a built-in value type that takes two bytes. It represents the System.Char type.
There are multiple ways to do this.
char c = 'c';char c = '\u0063'; //Unicodechar c = '\x0063'; //Hexchar c = (char)99;//Integral
A char can be implicitly converted to ushort, int, uint, long, ulong, float, double, or decimal. The conversion uses the character's numeric code unit.
char c = 'c';
ushort u = c;
returns 99 etc.
There are no implicit conversions from other types to char. You must cast them.
ushort u = 99;
char c = (char)u;
Found a mistake? Have a question or improvement idea?
Let me know.
Table Of Contents