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 trialJeff Rutherford
2,565 PointsString Interpolation challenge - need help
I've tried this multiple times, and I can't figure out the error messages I'm getting. Here's my code:
let name = "Jeff"
let greeting = "(Hi there), (name)"
4 Answers
Deepa Subramanian
194 PointsI am stuck with task 2, I got the first one right. When I use interpolated strings....i was given an error to use concatenation and when I used concatenation ....I get an error as use interpolated strings. While the output on Xcode storyboard is correct and it does not give me any error.
Jeff Rutherford
2,565 PointsActually, I ended up getting it.
The "Hi there" was throwing me off. I kept trying to put it in brackets.
The code should have been.
let greeting = "Hi there, (name)."
Jeff Rutherford
2,565 PointsWhen I submit these comments, it's removing the slash before (name).
Lisa Nguyen
22,731 PointsSame with mine, I thought it was a glitch so I tried deleting the comment to see if it would work the second time round :)
Deepa Subramanian
194 PointsFigured it out! string 1 = name string 2 = greeting interpolatedString = (string 1) (string2) finalGreeting = "(string 1) (string2)" "Greeting string"