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 trialBen Richardson
419 PointsHow to say something in a concatenated string after a constant.
I don't understand why the editor is saying my code is wrong even when Xcode says I did it right. How does the treehouse editor want me to use a concatenated string.
// Enter your code below
let name = "Ben"
let greeting = "Hi there, \(name)."
let finalGreeting = "\(greeting). How are you?"
1 Answer
Steve Hunter
57,712 PointsHi Ben,
This:
"\(var) is interpolation"
And this:
var + " is concatenation"
Make sense?
Steve.
Arsen Holsteinson
3,147 PointsArsen Holsteinson
3,147 PointsThe way you are doing it finalGreeting prints as "Hi there, Ben.. How are you?" (note the extra dot after Ben). I would guess that the editor sees that as an error. Try doing...
See if it works. Try to output the greeting with the same format as the instructions.