April 2026
Intermediate
683 pages
25h 29m
English
We took a sneak peek at text handling in Swift earlier by assigning string values to variables. In this section, we’ll give you a proper introduction to text in Swift, followed by a look at useful Swift mechanisms for string handling.
Let’s start by getting to know strings a little better. A string is a sequence of characters used to represent text in programming. Those characters can be letters, numbers, or symbols. Listing 2.39 demonstrates some basic string declarations in Swift.
let greeting: String = "Hello!"let greeting2: String = "Hello 2!"let name = "Kerem" // Auto-recognized as String
Listing 2.39 Some String Declarations in Swift
So far, so good; there’s nothing too different from our former ...
Read now
Unlock full access