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 trialThomas Hoffmann
903 PointsString Manipulation that doesn't get approved by treehouse quiz system
Hello,
I am trying to complete the quiz/check-up for the lesson, I feel like I am doing everything right since on my xCode it works. But when I check my work through Treehouse it says the string greeting is not interpolated.
let name = "Bruce" let greeting = "Welcome home"
let interpolatedGreeting = "(greeting), (name)."
what am I doing wrong that it doesn't validad my answer?
let name = "Linda"
let greeting = "Hi there"
let interpolatedString = "\(greeting), \(name)."
1 Answer
Jennifer Nordell
Treehouse TeacherIt wants the "Linda" part added to the end of the greeting using string interpolation. It seems like you understand interpolation, just not what they're asking for.
// Enter your code below
let name = "Linda"
let greeting = "Hi there, \(name)."
Generally speaking, challenges are very strict. Try to avoid making any variables or functions that they don't explicitly ask for. Even though your code may be functional, it can still cause the challenge to fail.
Thomas Hoffmann
903 PointsThomas Hoffmann
903 PointsI had to read the question like five times to finally understand what they wanted specifically. Thanks hastily reply Jennifer!
Jennifer Nordell
Treehouse TeacherJennifer Nordell
Treehouse TeacherThomas Hoffmann I promise that you'll reread instructions plenty of times throughout your time here on Treehouse. I can just about guarantee you that we've all fallen victim to not understanding exactly what they're asking for. Sometimes I sit there and think: "Ok. I know what I think they wanted, but what did they actually say." Only very rarely are they the same thing :)