Forums
Learn
Careers
Store
About
SUBSCRIBE
WWDC23 SALE: Save 50% on all my Swift books and bundles! >>
Question 1/6: Which of these lines use string interpolation?
Hint: String interpolation starts with a backslash, then contains a value inside parentheses. Click to show.
Option 1:
var name = "\(firstName) \(lastName)"
This uses string interpolation to create a string variable called name.
name
Option 2:
var versionString = "You're using v(version)"
String interpolation is written as \(reason).
\(reason)
Correct!
Oops – that's not correct.
Return to Review Menu
You are not logged in
Link copied to your pasteboard.