A view of a string’s contents as a collection of Unicode scalar values.
Swift Standard Library
You can access a string’s view of Unicode scalar values by using its unicodeScalars property. Unicode scalar values are the 21-bit codes that are the basic unit of Unicode. Each scalar value is represented by a Unicode.Scalar instance and is equivalent to a UTF-32 code unit.
Some characters that are visible in a string are made up of more than one Unicode scalar value. In that case, a string’s unicodeScalars view contains more elements than the string itself.
You can convert a String.UnicodeScalarView instance back into a string using the String type’s init(_:) initializer.
This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.