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

Kepler Murat
Kepler Murat
122 Points

why is it wrong?

I checked it on xcode and it works...

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

4 Answers

Michael Hulet
Michael Hulet
47,912 Points

Your syntax here is valid, but it doesn't do what the challenge asks. The challenge asks you to have the full sentence, including your name interpolated into it, in the greeting constant instead of creating a 3rd interpolatedGreeting variable. Also, be sure to put a space after the comma (,) in the sentence. After making those changes, your code passes the challenge for me

Kepler Murat
Kepler Murat
122 Points

hey man thanks for the help but it is still not letting me move on.

Michael Hulet
Michael Hulet
47,912 Points

What code did you try this time?

Kepler Murat
Kepler Murat
122 Points

let name = "Kepler" let greeting = "Hi there" let interpolatedGreeting = "(greeting), (name)"

Michael Hulet
Michael Hulet
47,912 Points

Again, you don't need to make a 3rd constant to pass the challenge. All you need is greeting, not interpolatedGreeting. Also, your syntax for interpolation was valid in the code you tried at first, but not in this one. Don't forget the backslashes (\)! That being said, it's good you added a space after the comma (,) in this one. That part is necessary to pass

Kepler Murat
Kepler Murat
122 Points

you know what... it's not working I am seriously stuck I cannot see what I am doing wrong.