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 trial

iOS Swift Basics Swift Types String Manipulation

HOW DO I DO THIS IS JUST DID THE SAME AS THE PREVIOUS LESSON

HOW DO I CODE THIS

strings.swift
let name = "James Warburton"
let greeting = "Hi there"
let interpolatedGreeting = "\(greeting), \(name)"

3 Answers

Greg Kaleka
Greg Kaleka
39,021 Points

Hi James,

You're so close! You've just added an extra step. The constant greeting itself needs to be equal to "Hi there, James Warburton". No need to add an additional constant. The good news is you just need the delete key to fix this :)

// Enter your code below
let name = "James Warburton"
let greeting = "Hi there, \(name)"

Cheers :beers:

-Greg

Thanks mate really appreciate it

Thanks so much mate I just had to many things on

douglas madson
PLUS
douglas madson
Courses Plus Student 10,182 Points

The first part of the challenge us asking you to create a constant named name with a string containing you name. You have this correct: let name = "James Warburton"

Once you have the name constant you are being asked to create another constant named greeting that is set to an interpolated string that "Hi there, " with the name constant you just created.

So you just need to something like this: let greeting = "Hi there, " (the constant you created that contains your name)"

For part two of the challenge you should concatenate the constant "greeting" with the string " How are you?"

Good luck! I hope this helps