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 2.0 Basics Swift Types String Manipulation

pls help so confused right know

Can anybody help this is super confusing to me

strings.swift
// Enter your code below
let name = "bebas"
let greeting = "Hi there \(name)."
let finalGreeting = "\(greeting), \(name) + "How are you?"
David Papandrew
David Papandrew
8,386 Points

Bebas, the 3rd constant, finalGreeting, has an improperly closed string.

You could do this, for instance: let finalGreeting = "(greeting), (name)" + "How are you?" [note the close quote after (name)]

Or, you could do this: let finalGreeting = "\greeting), (name) How are you?" [where you remove the leading quotation and plus symbol between (name) and How]

1 Answer

You are very close. You are just missing a period in the "greeting" and a space in the second string of "finalGreeting"

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