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

string

let name = "Tenzin" let greeting = "Hi there," let anotherName = "Linda" let interpolated = name + "," + greeting +"," + anotherName // string Interpolation let interpolationName = "(greeting), (anotherName)"

but its not working please help me find a solution

Kyle Lambert
Kyle Lambert
1,969 Points
let name = "Tenzin"
let greeting = "Hi there" 
let anotherName = "Linda" 
let interpolationName = "\(greeting), \(anotherName)"

2 Answers

not working i used your solution let name = "Tenzin" let greeting = "Hi there" let anotherName = "Linda." let interpolationName = "(greeting), (anotherName)" please help me

Luke Morgan-Scott
Luke Morgan-Scott
4,815 Points

Kyle's answer worked for me. Making sure to put the backward slash () in front of the variable names in parentheses should allow the strings to replace those variable names. Ex:

 let interpolationName =  "\(greeting), \(anotherName)"