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

Part Two What am I doing wrong String Interpolation

In the playground my code is correct but not when I put it in the challenge

let name = "Bill"

let greeting = "Hi, there (name)"

let finalGreeting = " (greeting) How are you?"

strings.swift
// Enter your code below

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

 let finalGreeting = "\(greeting) How are you?"

7 Answers

Moses Williams III
Moses Williams III
28,802 Points

let name:String = "Bill" let greeting:String = "Hi there, " let finalGreeting:String= "(greeting),(name)" This should work

Thank you

Brent Petit
Brent Petit
7,860 Points

Part two of the challenge specifies that you should use string concatenation rather than string interpolation.

They are looking for something like,

let finalGreeting = string1 + string2

thank you

Hi Bill,

your code is correct , if you are unable to submit in the editor you can just copy and paste from the Xcode. Try it , it worked for me.

Sam Katz
Sam Katz
2,986 Points

Be careful of spaces. it's an escape character (/)