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

Gennaro Turco
Gennaro Turco
2,557 Points

Can't see what's wrong

Can you tell me what's wrong in this code please? I am not able to fix this!

strings.swift
// Enter your code below
let name = "Gennaro"
let greeting = "Hi there"

let interpolateGreeting = "\(greeting), \(name)"

1 Answer

Ryan Lee
Ryan Lee
13,806 Points

Hi Gennaro,

Read the description again, looks like you left out a step. The greeting should be an interpolated value,

"Hi there, \(name)"

the final greeting at the end however they want you to concatenate.

let finalGreeting = greeting + ". How are you?"
Gennaro Turco
Gennaro Turco
2,557 Points

Understood! That's how I should've done! Thank you!!

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