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

andrew neves
andrew neves
3,055 Points

also having trouble with concatenating

please someone help with this I've been to understand how to bring the two together but can't figure it out

strings.swift
// Enter your code below
let name = "andrew"
let greeting = "Hi there, \(name)"
let finalGreeting = (\ greeting) \."(How are you?)"
Randell Purington
Randell Purington
9,992 Points

Hello. You are close. You are understanding the concept but are adding a little too much. Remove the extra \ after the greeting and add + between the greeting and the string. When you concatenate you want to use the addition symbol.

1 Answer

Hi Andrew,

The question asks for concatenation which is using + to add strings together - you've tried to use interpolation.

Make sure your \(varName) is inside a string, i.e. within double quotes, if you use interpolation. I think here, you want to add "How are you?" after greeting.

Steve.