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

Peter Torres
Peter Torres
1,784 Points

How do I complete Challenge Task 2 of 2 for Swift 3 Basics? The instructions are confusing to me? Thank you.

I feel like I'm doing the correct coding but the video examples don't seem to work with the task.

strings.swift
// Enter your code below
let name = "Peter"
let greeting = "Hi there, \(name) + How are you?"

let finalGreeting = greeting
Peter Torres
Peter Torres
1,784 Points

I do realize that the last constant is wrong, but I don't see how it should be according to the instructions.

1 Answer

Guillermo Tafur
PLUS
Guillermo Tafur
Courses Plus Student 1,089 Points

The greeting constant should only contain "Hi there, (name)" It is asking you to add "How are you?" in the last constant by using the addition operator. So it goes like this:

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

let finalGreeting = greeting + " How are you?"

Peter Torres
Peter Torres
1,784 Points

I see. Cool! Thank you.