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

holy pierre
holy pierre
333 Points

why am i getting an error?

i ran the code into xcode and it seems to read it - final read is indeed "hi there, linda"

strings.swift
// Enter your code below

let name = "Linda"
let greeting = "Hi there,"
let interpolateGreeting = "\(greeting) \(name)"

2 Answers

Jason Anders
MOD
Jason Anders
Treehouse Moderator 145,860 Points

Hey Holy,

You just went a bit more than what the challenge asked for. For Task 1, you should only have two constants -- name and greeting. The challenge never asked for interpolatedGreeting. You need to have the string and the string interpolation the constant greeting.

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

Hope that helps. Remember, challenges are very picky and very strict in what is being asked and expected. If you add or delete... it usually results in a Bummer! :)

:dizzy:

holy pierre
holy pierre
333 Points

Hi Jason,

A major LOLZ on my part! You are right, I went a bit too fast. My dearest apologies for contacting you on a matter I could have handled, had a slowed down a bit, and thoroughly read the statement ! Let's blame my excitement?

Thank you so much!!

h

Jason Anders
Jason Anders
Treehouse Moderator 145,860 Points

No Worries at all! :smiley: Us people of the community are always here! I hope you enjoy your Swift 2 journey of learning!

:dizzy: :)