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

I feel like I'm following the exact steps to create an interpolated string, however I keep getting an error message

I feel like I'm following the exact steps to create an interpolated string, however I keep getting an error message that I need to make sure the value I am assigning is an interpolated string. also, the preview check is a black screen with no feedback on what to correct. help is appreciated.

strings.swift
// Enter your code below
let name = "robin"
let greeting = "Hi there," 
//String Interpolation
let interpolatedGreeting = "\(greeting) \(name)"

2 Answers

Jennifer Nordell
seal-mask
STAFF
.a{fill-rule:evenodd;}techdegree
Jennifer Nordell
Treehouse Teacher

You are doing great! However, the challenge never says to make a new constant named interpolated greeting. What it wants is for the string interpolation to happen on the greeting line. Here's what they're looking for.

// Enter your code below
let name = "robin"
let greeting = "Hi there, \(name)" 
//String Interpolation

Happy coding! :smiley:

thank you so much!! That worked for me. I was trying to follow the exact example as in the tutorial and thought of shorting it like you suggested, however at the time that didn't make sense to me.