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

Nathan Ming
Nathan Ming
1,723 Points

Hello forum, I'm having a problem with the strings .swift code challenge and i'm not sure where i have gone wrong.

I'm just not sure what to do to pass this challenge i don't know if i have to write in let interpolation and then my name will just pop up or what. i'm stumped here.

strings.swift
// Enter your code below
let name = "Nathan"
let greeting = "Hi there, name"

1 Answer

Justin Horner
STAFF
Justin Horner
Treehouse Guest Teacher

Hello Nathan,

In order to add your name to the greeting using string interpolation, you'll need to use the \(var) syntax like this.

let name = "David"
let greeting = "Hi there, \(name)"

I hope this helps.

Nathan Ming
Nathan Ming
1,723 Points

Justin! You saved me!!! Thank you so much :) I was super confused on this stage. I think another guy 3 hours ago has a similar problem.

Justin Horner
Justin Horner
Treehouse Guest Teacher

You're welcome! Glad I could help.

Happy coding :)