Beginning Swift 3 - Part 4: Strings | Ray Wenderlich

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

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]https://developer.apple.com/library/content/documentation/Swift/Conceptual/Swift_Programming_Language/StringsAndCharacters.html#//apple_ref/doc/uid/TP40014097-CH7-ID295