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

Concatenation error

I've been playing around with this code challenge for close to an hour, and not sure what else I am missing.

Error: Make sure you're using concatenation to create the final string value required!

strings.swift
// Enter your code below
let name = "Scotty Venza"
let greeting = "Hi there, \(name)."
let finalGreeting = "How are you?"

let finalGreetingPhrase = "\(greeting) \(finalGreeting)"

This is string interpolation not concatenation. concatenation would be greeting + " " + finalGreeting

1 Answer

Jennifer Nordell
seal-mask
STAFF
.a{fill-rule:evenodd;}techdegree
Jennifer Nordell
Treehouse Teacher

Hi there! I'm just going to give a hint here. Remember that concatenation is putting two strings together using a plus sign. Take a look at the following sample:

let str1 = "Hello"
let str2 = "Scott"
let str3 = str1 + ", " + str2

The end result will be that str3 will contain "Hello, Scott". Try again, with these hints in mind! :sparkles: