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

villa
villa
6,171 Points

Second, declare a constant named greeting. Set the value of greeting to an interpolated string that combines "Hi there,

Bummer! Make sure the value your are assigning to greeting is an interpolated string.

strings.swift
// Enter your code below
let name = "Juan"
let greeting = "Hi there"
let interpolatedString = "\(greeting), \(name)"

3 Answers

Hi Juan Luis, Just to add to the above comment, it still needs a backslash before (name), and a period.

SO: let name = "Juan" let greeting = "Hi there" let interpolatedString = "Hi there, (name)."

This is what was accepted, I also originally wrote it the way you did, and got the bummer message, although your code works in playground...

Christian Kroul
Christian Kroul
9,849 Points

Here you go

let name = "bob"

let greeting = "Hi there, \(name)"            
Pablo Santos
Pablo Santos
231 Points

This is the one that worked; there were several of them that didn't work throughout this website. Thanks for your help

villa
villa
6,171 Points

Thanks Lara and Christian