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

Elizabeth Barker
seal-mask
.a{fill-rule:evenodd;}techdegree
Elizabeth Barker
Front End Web Development Techdegree Student 1,153 Points

Combining message with interpolated string

Hi,

On line 2, I am not sure what I am doing incorrectly. How do I incorporate the message "Hi there" with the rest of the interpolated string?

Thanks!

2 Answers

Jake Adams
Jake Adams
1,608 Points

String interpolation is when you have a hardcoded string value like "Hi there," and you insert a variable directly into that string using the \() syntax.

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