Strings are not like integers, floats, and Booleans. A string is a sequence, which means it is an ordered collection of other values. In this chapter you’ll see how to access the characters that make up a string, and you’ll learn about some of the string helper functions provided by Julia.
English language speakers are familiar with characters such as the letters of the alphabet (A, B, C, …), numerals, and common punctuation. These characters are standardized and mapped to integer values between 0 and 127 by the ASCII standard (American Standard Code for Information Interchange).
There are, of course, many other characters used in non-English languages, including variants of the ASCII characters with accents and other modifications, related scripts such as Cyrillic and Greek, and scripts completely unrelated to ASCII and English, including Arabic, Chinese, Hebrew, Hindi, Japanese, and Korean.
The Unicode standard tackles the complexities of what exactly a character is, and is generally accepted as the definitive standard addressing this problem. It provides a unique number for every character on a worldwide scale.
Char value represents a single character and is surrounded by single quotes:
'x': ASCII/Unicode U+0078 (category Ll: Letter, lowercase)
'🍌': Unicode U+01f34c (category So: Symbol, other)
Even emojis are part of the Unicode standard (
A string is a sequence ...