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

Fatimah Aljawi
Fatimah Aljawi
211 Points

I am not able to produce this question whatever I did based on the basic knowledge I have so far

// Enter your code below let name = "Fatimah"

let greeting = "hello, (name)"

let finalGreeting = greeting + "how are you?"

what is the concantation result for this problem

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

let greeting = "hello, \(name)"

let finalGreeting = greeting + "how are you?"

2 Answers

Everything is fine except for the fact that prepended the message "hello, " instead of "hi there, "

Code challenges are incredibly picky, sorry to say :/

"Hi there, Pasan. How are you?"

To get it exactly like they have it looks like you missed:

  1. Hi there, instead of hello
  2. A period after (name)
  3. A space before How
// Enter your code below
let name = "Fatimah"

let greeting = "Hi there, \(name)."

let finalGreeting = greeting + " How are you?"