Learn about strings in Swift 3.
This is a companion discussion topic for the original entry at https://www.raywenderlich.com/4095-beginning-swift-3/lessons/4
Learn about strings in Swift 3.
The second solution you provide - while giving the right answer is not what your are looking for from the student. You asked the students to add the āfirstNameā and ālastNameā constants.
Your solution is : let fullName = āBrianā + " " + āMoakleyā
In the solution provided added string literals - not the previously defined constants
The solution should be: let fullName = firstName + " " + lastName
nit: At 2:23 the interpolated string is presented as
Hello my name is Brian
correction:
Hello my name is Brian!
(exclamation mark missing).
At 5:33, the escape character ā\nā is referred to as a ācarriage returnā, when itās actually known a āline feedā. The escape character for ācarriage returnā is ā\rā.[1]
[1]Strings and Characters ā The Swift Programming Language (Swift 5.7)