Swift BasicsLesson 12Free preview
Swift Strings
This lesson is part of Swift · All levels
Summary
This lesson reviews the String data type in Swift that is fully compatible with the latest Unicode standards. Strings in Swift are efficient value types with Copy-on-Write (COW) optimization. The developer will learn text manipulation, multi-line strings with three quotes, as well as accurate character counts.
Key points
- The strings in Swift fully support the international Unicode standard and emoji accuracy
- Multi-line strings are flanked by three double quotes '"""...""""
- The property '.count' counts the number of human display characters (grapheme clusters)
- String is a value type (copied while passed), but optimized with copy-on-write
Full lesson
Code examples and quizzes
Full lessons, code examples, and quizzes are available to subscribers. 5 questions.