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

Salaam Hill
PLUS
Salaam Hill
Courses Plus Student 892 Points

See Any Errors

I am not sure what I am doing wrong here. The error says that I need to make sure the constant greeting is interpolated. I believed I had done so.

strings.swift
// Enter your code below
let name = "Salaam"
let greeting = "Hi there"

let greetingPerson = greeting + "," + name

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

2 Answers

Hi Salaam,

It's not letting you pass the Challenge because you're creating too many variables that were not requested. In the first part of the Challenge, name should contain any string you like — such as your name — but greeting is supposed to contain a string value corresponding to, "Hi there, Salaam". The means of combining these two strings — for this first part of the Challenge — is Interpolation.

For the second part of the Challenge, you are to concatenate the value you already have in greeting with the string, ". How are you?" This concatenation is then to be stored in a constant named finalGreeting.

The instructions are usually explicit in these Challenges for a reason; if you don't follow them to the letter, the answer checker will simply not let you pass. But, if you fix the above concerns, the Challenge should let you pass :)

Salaam Hill
Salaam Hill
Courses Plus Student 892 Points

Thank you very much for your help, I appreciate it!

Salaam Hill
PLUS
Salaam Hill
Courses Plus Student 892 Points

On another note. I just downloaded Xcode on my MacBook Pro but I can't figure out how to get the results screen to the right to be displayed. Any suggestions?