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

Hi, I'm not sure why my codes not working. its working in my xcode fine. thanks

let name = "daniel" let greeting = "hi there"

let interpolatedGreeting = "(name) (greeting)"

strings.swift
let name = "daniel"
let greeting = "Hi there"

let interpolatedGreeting = "\(name) \(greeting)"

1 Answer

Jason Anders
MOD
Jason Anders
Treehouse Moderator 145,858 Points

Hi Daniel,

I feel you have misread the instructions. The instructions say nothing about creating a variable called interpolatedGreeting. It does ask you to create a variable greeting that has a string ("Hi there,") and the interpolated variable name. So, the correct and complete code for this challenge will only have 2 lines and 2 variables.

While your code is correct in syntax and will produce the desired result, instructions for challenges need to be followed exactly or the challenge will fail.

Keep Coding! :) :dizzy: