Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

iOS Swift Basics Swift Types String Manipulation

JUAN BORRAS
JUAN BORRAS
716 Points

Help please

isn´t this the answer to a String Interpolation combining a string Concatenation, being the answer Hi there, Joan?

strings.swift
// Enter your code below


let name = "Joan"
let greeting = "Hi there,"

let interpolatedGreetingName = "\(greeting) \(name)"

2 Answers

andren
andren
28,520 Points

You do end up with the string the challenge is looking for, but the challenge wants that string stored in the greeting constant. It does not ask you to create a separate constant to hold it.

So if you do the interpolation within the string you store in greeting, like this:

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

Then your code will be accepted.

JUAN BORRAS
JUAN BORRAS
716 Points

Thanks Andren for your help