In addition to numbers, computer processing of information, mainly is the character. Characters include numeric characters, English letters, expression symbols, and so on, C # provides character types in accordance with internationally recognized standards, using the Unicode character set. Unicode has a standard character length of 16 bits, which can be used to represent most languages in the world. You can assign a value to a character variable in the following ways, such as:
Char c= ' A ';
Alternatively, we can assign a value (prefix \u) to a character variable directly through the decimal escape character (prefix \x) or Unicode notation, as follows the assignment of the character type variable is correct:
Char c= ' \x0032 '; //
Char c= ' \u0032 '; //
Note: in C and C + +, the value of a character variable is the Ascⅱ code represented by the variable, and the value of a character variable is part of an integer that can be assigned and evaluated with an integer for a character variable. And this is forbidden in C #.
As in C, C + +, there is still an escape character in C # that is used to substitute special control characters in the program.
Table 4-2 escape characters (escape sequences)
Escape character name
\ ' single quote
\ ' double quotation mark \ backslash
\a exclamation mark (Alert)
\b backspace
\f New line
\ r \ n enter
\ t horizontal tab
\v Vertical tab