For the More Curious: Unicode
As you have learned, a string consists of an ordered sequence of characters, and a character is an instance of the Char type. Specifically, a Char is a Unicode character. The Unicode character encoding system is designed to support “the interchange, processing, and display of the written texts of the diverse languages and technical disciplines of the modern world” (unicode.org).
This means the individual characters in a string can be any of a diverse palette of characters and symbols – 136,690 of them (and growing) – including characters from the alphabet of any language in the world, icons, glyphs, emoji, and more.
To declare a character, you have two options. Both are wrapped in single quotes. For ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access