Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

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,019 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