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

make sure that greeting is an interpolation string

help

strings.swift
// Enter your code below
let name="labbey"
let greeting="Hi there"
greetings="\(name),\(greeting)"
let name = "Jeff Bezos"
let greeting = "Hi there, \(name)"

Check your code, you assign the final greetings using the greetings variable which doesn't exist, you need to do the string interpolation in the instantiation of greeting constant

Emin Grbo
Emin Grbo
13,092 Points

@Amazon Web, you are right, just make sure to post it as an answer, not a comment :) So the user can mark your answer as correct or others can upvote it as well :)

This confused me few times as well...since comment is just below the question, but answer area is way on the bottom.

Emin Grbo

Thank you so much, I've posted a lot of comments here in the community without knowing that is not the way to answer a question :)

Will keep this in mind.

1 Answer

let name = "Jeff Bezos"
let greeting = "Hi there, \(name)"

Check your code, you assign the final greetings using the greetings variable which doesn't exist, you need to do the string interpolation in the instantiation of greeting constant