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

confuse

need to show answer after a million try

strings.swift
// Enter your code below
let name = "shamir"
let greeting = "\(hi there)"

2 Answers

Hi,

You didn't interpolate the first constant into the second. the result should be "Hi there + Shamir or whatever name you will have write in the first string.

Will Matthews
Will Matthews
8,127 Points

Hey Shamir,

When using interpolation, you want to insert the constant or variable into the string, using the constant's label in the brackets, not the string.

So if the goal is "Hi there, Shamir" then you'll what to assign the following to greeting instead...

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

Hope that helps!