Character and String Data Types
Explore the use of Swift String and Character data types, including the use of Unicode and special characters. Also, learn how to build strings from multiple variables using string interpolation.
Character data type
The Swift Character
data type is used to store a single character of rendered text such as a letter, numerical digit, punctuation mark, or symbol. Internally, characters in Swift are stored in the form of grapheme clusters. A grapheme cluster is made of two or more Unicode scalars that are combined to represent a single visible character.
The following lines assign a variety of different characters to Character
type variables:
Get hands-on with 1400+ tech skills courses.