Forums
Learn
Careers
Store
About
SUBSCRIBE
UPGRADE YOUR SKILLS: Learn advanced Swift and SwiftUI on Hacking with Swift+! >>
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 \(version).
\(version)
Correct!
Oops – that's not correct.
Return to Review Menu
You are not logged in
Link copied to your pasteboard.