Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

iOS Swift Basics Swift Types String Manipulation

Andrew Koslov
Andrew Koslov
2,045 Points

String Manipulation Challenge

I have been getting a message that says that Task One is wrong after inputing the finalGreeting concatenation. I am not sure if there is a glitch or I am off base, but previous question answers have the code formatted the same way.

strings.swift
// Enter your code below
let name = "koz"

let greeting = "Hi there,\(name)."
let finalGreeting =  greeting + " How are you?"

1 Answer

andren
andren
28,521 Points

You have removed the space between the comma and the name in the greeting string which you wrote in task 1. That is why you are being told your code no longer passes task 1.

I assume you did that accidentally while working on task 2, if you add it back in like this:

let name = "koz"

let greeting = "Hi there, \(name)." // Added a space
let finalGreeting =  greeting + " How are you?"

Then your code will be accepted.