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

I did everything right

Why is not working?

strings.swift
// Typing code
let name = "Jacob"

let greeting = "Hi there"

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

1 Answer

Jennifer Nordell
seal-mask
STAFF
.a{fill-rule:evenodd;}techdegree
Jennifer Nordell
Treehouse Teacher

Hi there! Close, but not quite. The instructions say explicitly that the interpolated string should be assigned to the constant greeting, but your interpolated string is assigned to a constant that was never asked for by the challenge. That being said, the value stored inside your last constant is what it's looking for, but the solution is simpler than you may expect. This is the line that was expected:

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

:bulb: Going forward, try not to do anything not explicitly asked for by the challenge. Even if functional outside of the challenge, it can cause it to fail. Remember, this is a piece of software that is grading your code, so the results must match to the letter. This includes variable/constant names, capitalization, spelling and even spacing! :smiley:

Thank you very much! I'm a young coder that is trying to work my way up to be a software engineer and the community on this site is amazing! Thank you for the fast response, can't say it enough!