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 Strings

i am having a problem with the interpolation question on swift ,i dont know what is going on

Help me please i want the answer to appear like (hi, there john) here is my code i'm trying to use interpolation let name = "john"

let greeting = "hi, there (name)"

10 Answers

Jeff McDivitt
Jeff McDivitt
23,970 Points

You almost have it, you forgot the backslash in front of name.

let name = "Jeff"
let greeting = "Hi there \(name)"

i tried but it says (make sure you are assigning the correct string to the variable) this is what i wrote

let name = "john"

let greeting = "hi there (name)"

Jeff McDivitt
Jeff McDivitt
23,970 Points

You still don't have the back slash in front of your variable see my example

I'm sorry I didn't write the comment correctly what I actively wrote is this

let name = "john"

let greeting = "hi there (name)"

I try to write the backslash but it doesn't appear I don't know why

Jeff McDivitt
Jeff McDivitt
23,970 Points

I am not sure why you cannot have a back slash there but you will need it to pass the challenge

what am I suppose to do

Jeff McDivitt
Jeff McDivitt
23,970 Points

Copy and paste what I sent you

Hi guys I'm stuck here its not working please help let name = "sherry" let greeting = "Hi there (name)"

Jeff McDivitt
Jeff McDivitt
23,970 Points

Hi Shariff - In your code you still do not have a back slash in front of your name variable which is using string interpolation

let name = "Jeff"
let greeting = "Hi there \(name)"

Guys its not working help please

let name = "Sherry" let greeting = "Hi, there(name)"

//this ain't working guys. but on linux swift its working help me guys I'm kinda stuck

let name = "sherry" let greeting = "Hi there (name)"

//Even this not working

let name = "sherry" let greeting = "Hi there " let interpolatedGreeting = "Hi there (name)"

Is not working for me too. Im the video it doesn't have this kind of sting. Help!!!

Hi there, I was having the same problem. make sure you don't forget the comma after hi there

Why am i not allowed to put how are you?

im having the same problem , did you solve this