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 trialJoe Ford
Courses Plus Student 1,341 PointsIssue with String Concatenation 2 of 2
I've tried two methods that compiled without issue in Playgrounds.
First:
let name = "Joe"
let greeting = "Hi there, \(name)."
let finalGreeting = "\(greeting) How are you?"
Second:
let name = "Joe"
let finalGreeting = "How are you?"
let greeting = "Hi there, \(name). \(finalGreeting)"
Neither method worked for the code challenge.
// Enter your code below
let name = "Joe"
let greeting = "Hi there, \(name)."
let finalGreeting = "\(greeting) How are you?"
1 Answer
Alex Koumparos
Python Development Techdegree Student 36,887 PointsHi Joe,
Your problem is that you are still using string interpolation in finalGreeting but the challenge is asking for string concatenation.
Cheers
Alex
Joe Ford
Courses Plus Student 1,341 PointsJoe Ford
Courses Plus Student 1,341 PointsNevermind. I needed to read the instructions more carefully. I was using string interpolation and not concatenation.