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 trialElizabeth Sievwright
830 PointsString Interprolation does not work
In this challenge I was asked to concatenate name and greeting,
Here is my code:
let name = "Graham" let greeting = "Hi there"
let interpolatedName = "(name), (greeting)"
This code works in Xcode but not here
Thanks
// Enter your code below
let name = "Graham"
let greeting = "Hi there, "
let interpolatedName = "\(name), \(greeting)"
2 Answers
Steve Hunter
57,712 PointsHi Elizabeth,
That part of the challenge wants you to use concatenation, +
, not interpolation.
let name = "Steve"
let greeting = "Hi there, \(name)."
let finalGreeting = greeting + " How are you?"
Steve.
Ryan Sands
4,543 Pointsconcatenation is needed here:
let name = "Ryan" let greeting = "Hi there, (name)." let finalGreeting = greeting + " How are you?"
I hope this helps... keep coding on!!
-Ryan