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 trialjonathan Appiah Bannor
444 Pointshi guys! can you give me a hand in this one? many thanks jonathan
helps
let name = "Jonathan Appiah Bannor."
let greeting = "Hi there,(name)"
let finalGreetting = "(greeting), (How are you)
4 Answers
Mitchel Andrews
4,745 PointsRecall when you use string interpolation the syntax looks like this:
let name = "Mitchel"
let greeting = "Hi, \(name)"
In the code snippet you provided, you're forgetting the '\' before the variable name. Overall, it should look like this:
let name = "Mitchel"
let greeting = "Hi there, \(name)"
let finalGreeting = "\(greeting), how are you?"
Mitchel Andrews
4,745 PointsSorry, I didn’t read the challenge carefully. In the second task they would like you to use concatenation in the final greeting. The way I showed isn’t incorrect, however it wasn’t the way the challenge was asking. Overall, it should look like this:
let name = “Mitchel”
let greeting = “Hi there, \(name)”
let finalGreeting = “\(name).” + “How are you?”
jonathan Appiah Bannor
444 Pointsstill not working. can anyone help me out? please
jonathan Appiah Bannor
444 Pointsno worries! many thanks
jonathan Appiah Bannor
444 Pointsjonathan Appiah Bannor
444 Pointshi Mitchel! thanks for answering back to me. but Unfortunately still doesn't work. did you know why?