Many languages have a type like
char which represents a character, usually ASCII,
since the size of
char is defined as 1 byte.
V does not have a
char type as such (the
u8 type can be used instead),
instead V has a
rune represents a single Unicode character and is an alias for
To denote them, use
rune can be converted to a UTF-8 string by using the
rune can be converted to UTF-8 bytes by using the
Hex, Unicode, and Octal escape sequences also work in a
rune literals use the same escape syntax as strings,
but they can only hold one Unicode character.
Therefore, if your code does not specify a single Unicode character,
you will receive an error at compile time.
Also remember that strings are indexed as bytes, not runes, so beware:
A string can be converted to runes by the