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 trialMansa Gory
3,466 PointsClues please, I can't figure out what I'm missing let name = "Mansa" let greeting = "\("Hi there,"), \(name)"
I'm stuck on the 2nd step of this code challenge, string interpolation. Clues please.
let name = "Mansa" let greeting = "("Hi there,"), (name)"
// Enter your code below
let name = "Mansa"
let greeting = "\("Hi there,"), \(name)"
3 Answers
Xavier D
Courses Plus Student 5,840 PointsHi,
I see that your second constant has one too many commas. Try removing one from either inside the first string interpolation, or the one just after the first string interpolation, or just remove the first string interpolation from the first string from the second constant altogether and concatenate the second constant's first string with it's second string in the second interpolation that has your first constant passed in.
Hope this helps...
Mark Carrel
9,873 PointsHi Mansa,
You asked for clues, so hopefully I won't give away too much but I think the problem you are having is that you only need to treat the variable, "name" as a string literal by encapsulating just the variable in a "( )". Your code also encapsulates the text, "Hi there," as a string literal and that is probably the source of the error you are seeing.
Mansa Gory
3,466 PointsThanks for your help!
Giorgos Karyofyllis
21,276 Points// Enter your code below
let name = "Mansa"
let greeting = "\("Hi there,") \(name)"
let finalGreeting = greeting + "How are you?"
Mansa Gory
3,466 PointsThanks!
Mansa Gory
3,466 PointsMansa Gory
3,466 PointsThanks for your help! The error was coming from the extra comma.