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

Not understanding what I am doing wrong with Task 1 using Interpolation.

// Enter your code below let name = "Bindi"

let interpolatedGreeting = "(Hi there,)"

let greeting = "(interpolatedGreeting) (name)"

strings.swift
// Enter your code below
let name = "Bindi"

let interpolatedGreeting = "\(Hi there,)"

let greeting = "\(interpolatedGreeting)" "\(name)" 

1 Answer

Alphonso Sensley II
Alphonso Sensley II
8,514 Points

Hello bindipatel you're almost there! Your syntax is a little off and the instructions weren't followed exactly right. The challenge only asks for us to create two constants. name & greeting. The final value of greeting should be an interpolated string of "Hi there" and the name constant. Keep up the practice and you'll have it in no time!

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

oh wow. More simple than I thought! Thank you Alphonso