iOS Swift Basics Swift Types String Manipulation

Julian Addison
Julian Addison
2,281 Points

Why won't this code pass the test?

I don't understand what is going on here. I've run the code in Xcode and it doesn't give me any problems and has the correct output. Am I missing something?

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

let finalGreeting = "\(greeting). How are you?"

1 Answer

Brendan Whiting
MOD
Brendan Whiting
Front End Web Development Treehouse Moderator 82,123 Points

To build up finalGreeting, they want you to use concatenation instead of interpolation. It will produce the same result, but they just want to make sure you have both tools at your disposal.

Julian Addison
Julian Addison
2,281 Points

Thanks! Should have read the prompt better, makes sense.