The char Type
In this page:
The char Type
A char represents a single UTF-16 character and is written with single quotes, like A. Characters can be compared, cast to their underlying numeric code point, and combined into strings. Double quotes are reserved for string, not char.
Note: Casting a char to int gives you its Unicode code point.
Example: The char Type
using System;
class Program
{
static void Main(string[] args)
{
char letter = 'A';
char digit = '7';
Console.WriteLine(letter);
Console.WriteLine((int)letter);
Console.WriteLine(char.IsDigit(digit));
}
}
Login to try C/C++/Java/PHP code in the editor
🔒
Chapter Quiz — Complete all 7 topics to unlock
0/7 topics done
Complete these topics first: