C#’s char
type (aliasing the
System.Char
type) represents a Unicode
character and occupies two bytes. A char
literal is specified inside single
quotes:
char c = 'A'; // Simple character
Escape sequences express characters that cannot be expressed or interpreted literally. An escape sequence is a backslash followed by a character with a special meaning. For example:
char newLine = ' '; char backSlash = '';
The escape sequence characters are:
Char | Meaning | Value |
---|---|---|
| Single quote |
|
| Double quote |
|
| Backslash |
|