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

Daniel Smithson
Daniel Smithson
1,076 Points

Nothing i try is working in the online compiler... I have done it exactly like the tutorial.

It isn't working even though i used the exact method from the video... I have tried different itteratios as well. The greet constant had to modified to get the compiler to work too... what going on?

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

2 Answers

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

The devil is in the details... or so they say. But this may be especially true of coding challenges. The challenge explicitly asks you to use concatenation, which is something that was covered earlier, I believe. Not very long ago at all I posted a solution together with a brief explanation of the difference between concatenation and interpolation. Take a look here:

https://teamtreehouse.com/community/i-am-not-getting-the-right-answer-and-i-dont-know-what-i-am-doing-wrong

Hope this helps! :smiley:

Daniel Smithson,

" + " = Concatenation

" () " = interpolation

let name = "Danni"
let greeting = "Hi there \(name)"
let finalGreeting =  greeting + "How are you?"