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 Interpolation

Angel Caro
Angel Caro
11,831 Points

Swift basics 2.0 string interpolation.

After watching the videos i thought i had a pretty good grasp on this, and when i took the code challenge it said it was wrong but it works in Xcode. This is the code i used in Xcode: let interpolatedGreeting = "(greeting), (name)." which is what was taught on the lesson but the answer required this: let greeting = "Hi there, (name)" and that would work on the challenge but not Xcode, Please advise.

5 Answers

Angel Caro
Angel Caro
11,831 Points

The second answer i posted was the answer someone posted on the forum which works on the challenge. The first line of code in my question works on Xcode but it won't pass the challenge.

Angel Caro
Angel Caro
11,831 Points

It passed without the backslash, it would not pass with it. Thats why i'm confused, thanks for your answer.

Dustin Honeck
Dustin Honeck
12,431 Points

You may have used a forward slash by accident.

Dustin Honeck
Dustin Honeck
12,431 Points

You may have used a forward slash by accident.