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

James Harrison
James Harrison
172 Points

I have no idea what is wrong here...

I've been stuck on this for over ab hour after sailing through step one. Guidance would be much appreciated, I believe the wording of the question is what is confusing me.

strings.swift
let name = "James Harrison"
let greeting = "Hi there, "
let finalGreeting = greeting + name + "." + " How are you?"

1 Answer

The challenge is looking for you to use both interpolation and concatenation.

The first part of the challenge was asking for the interpolation of the name constant in the greeting constant. Since it looks like you got to the second part of the challenge you should have at some point had:

let name = "James Harrison"
let greeting = "Hi there, \(name)."

Without changing the above code, the second part of the challenge is asking you to concatenate the two string from the constant greeting with the string " How are you?". You are already using concatenation in the example provided, correctly. Now you just have to drop everything except the greeting constant and the " How are you?" string:

let finalGreeting = greeting + " How are you?"