Character Type
The character type is represented by Rune, which can represent any character in the Unicode character set. A Rune literal starts with the character r, followed by a character enclosed in single or double quotes.
Character literals have three forms: single character (e.g., r'A'), escape character (e.g., r'\n', r'\t'), and universal character (e.g., r'\u{4f60}', followed by 1-8 hexadecimal digits representing a Unicode code point). Escape characters include newline \n, tab \t, backslash \\, etc.
The character type supports relational operators for comparison, comparing the Unicode code point values of the characters. Rune can be converted to UInt32, and integer types can also be converted to Rune (must fall within the valid Unicode range). The code on the right demonstrates basic character usage and escape characters.
Rune represents a single Unicode character, different from the string type String. A Unicode character may consist of multiple UTF-16 encoding units, but Rune always represents a complete code point.Try changing the character to another letter, Chinese character, or emoji, or use the universal character \u{...} notation.