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 trialcaraembry
2,906 PointsNot sure what I am doing wrong here to concantenate these to say: "Hi there, Cara. How are you?"
Concantenation lesson
// Enter your code below
let name = "Cara"
let greeting = "Hi there,\(name)."
let finalGreeting = "\(greeting) How are you?"
Steven Deutsch
21,046 PointsSpot on Karl! Remember the proper spacing for the finalGreeting though. :)
2 Answers
Steven Deutsch
21,046 PointsHey caraembry,
Your code is technically correct. You just aren't coming about the solution in the way that the challenge wants you to. You are using String Interpolation to create the finalGreeting when you need to be using String Concatenation.
// Enter your code below
let name = "Cara"
let greeting = "Hi there, \(name)."
let finalGreeting = greeting + " How are you?"
Good Luck
caraembry
2,906 PointsAhhhh that was it haha. Thanks everyone!
Karl Pfister
809 PointsKarl Pfister
809 PointsHi! I think I might be able to help. Im still a beginner too, so I may be wrong. However, what I think you're missing is that the code you have written is not concatenated. It is written using String Interpolation. Concatenated, I believe, should be similar to this: let name = "Cara" let greeting = "Hi there, " + name let finalGreeting = greeting + "How are you?"
I hope this works!