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

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,558 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.