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 2.0 Basics Swift Types String Manipulation

Jorge Jimenez
Jorge Jimenez
3,930 Points

Using string interpolation

Can someone please tell me what i'm doing wrong?

strings.swift
// Enter your code below
let name = "Jorge"
let interpolatedGreeting = "Hi there, \(name)."
Felix Ayala
Felix Ayala
5,541 Points

I don't see any errors in your code.

1 Answer

Cindy Lea
PLUS
Cindy Lea
Courses Plus Student 6,497 Points

Try this:

let name = "Jorge" let greeting = "Hi there, (name)."

The challenge specifically asked you to name the variable greeting & you named it something else so it marked it wrong. Always used the variables exactly as they ask.

Jorge Jimenez
Jorge Jimenez
3,930 Points

I think that both of you are correct. There's nothing wrong with the way I had written it, but the way it was accepted as correct is how Cindy wrote it. Thank you both for your help.