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 trialBill Foster
Courses Plus Student 185 PointsPart Two What am I doing wrong String Interpolation
In the playground my code is correct but not when I put it in the challenge
let name = "Bill"
let greeting = "Hi, there (name)"
let finalGreeting = " (greeting) How are you?"
// Enter your code below
let name = "Bill"
let greeting = "Hi, there \(name)"
let finalGreeting = "\(greeting) How are you?"
7 Answers
Moses Williams III
28,802 Pointslet name:String = "Bill" let greeting:String = "Hi there, " let finalGreeting:String= "(greeting),(name)" This should work
Bill Foster
Courses Plus Student 185 PointsThank you
Brent Petit
7,860 PointsPart two of the challenge specifies that you should use string concatenation rather than string interpolation.
They are looking for something like,
let finalGreeting = string1 + string2
Bill Foster
Courses Plus Student 185 Pointsthank you
Moses Williams III
28,802 PointsAnytime
Dayakar Reddy Marri
Courses Plus Student 366 PointsHi Bill,
your code is correct , if you are unable to submit in the editor you can just copy and paste from the Xcode. Try it , it worked for me.
Sam Katz
2,986 PointsBe careful of spaces. it's an escape character (/)