Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialSean Gilbert
2,186 PointsI can't pass this quiz :( I have tried so many times, and it seems so easy, yet is being awful to complete....
The question states to use string interpolation. I think I am?!? I have no idea, please help..
// Enter your code below
let name = "Sean"
let greeting = "Hi there, Sean"
// Now interpolated string
let interpolatedGreeting = ("Hi there, Sean".)
1 Answer
Marlon Burnett
Courses Plus Student 12,917 PointsHi Sean!
Interpolated strings means you use any expression that results in a string, on the string itself. In this case, the sole constants you have are already strings that you can use for interpolation with the syntax "\(you_variable_constant_or_expression)". An example of string interpolation would be
let myName = "Marlon Burnett"
let myAge = 26
let interpolatedString = "Hi! My name is \(myName). I'm \(myAge) years old!"