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

Aaron Bailey
seal-mask
.a{fill-rule:evenodd;}techdegree
Aaron Bailey
iOS Development Techdegree Student 305 Points

cant get past this question and i believe i did it right.

strings.swift
// Enter your code below

let name = "Aaron" let greeting = "Hi there"

let interpolatedGreeting = "(greeting) ,(name)."

Timothy Stratton
Timothy Stratton
287 Points
let name = "Aaron"
let greeting = "Hi there"

if you put separate statements on the same line, you have to separate with a semicolon

3 Answers

Nico Schmidt
Nico Schmidt
12,781 Points
// Enter your code below

let name = "Aaron"
let greeting = "Hi there, \(name)"
Luc Bernardin
Luc Bernardin
3,726 Points

The challenge asks you to declare 2 strings. You declared 3.

The first string contains your name.

The second string is called greeting and will include the value of your first string by using (name)

You forgot the \ for string interpolation before the variable names in ()

let name = "hiren" let greeting = "HI there, (name)"

Luc Bernardin
Luc Bernardin
3,726 Points

You're missing the \ infront of (name)