Strings—blocks of textual data—are another essential data type supported in nearly all programming languages, and Swift’s are really great. Let’s start a new playground to try them out: create the playground with File > New > Playground, and call it StringsPlayground.
Of course, right off the bat, the playground template creates a string for us with var str = "Hello, playground", which evaluates as Hello, playground in the results pane.
Since str is defined with the var keyword, it’s a variable, so let’s change it up a bit. Type the following:
|||str = str + "!!"|
This evaluates as Hello, playground!!, and proves that we can combine strings with the + operator. ...