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 trialOllie Drabble
3,058 Pointsim sure ive answered this right
Given the constant named language, write a println statement which will print the following string: "Learning Swift".
let language: String = "swift"
println("Learning/(language)")
let language = "Swift"
3 Answers
James Lambert
Courses Plus Student 14,477 PointsString interpolation is like this: var language = "Swift" println("Learning (language)")
you / when your should have \
The other way is call Concatenating. It will work in Xcode, just not in the exercise you were on. I should have noticed. Sorry.
Ollie Drabble
3,058 Pointsthank you for your help
jamescool
44,592 PointsJames, I think in the above example you have inadvertently omitted the backslash character.
Ollie Drabble
3,058 Pointsi tried that too and it still says i need to interpolate the 'language' constant
AR Ehsan
7,912 PointsMe too! What code do you have to type!
Ollie Drabble
3,058 Pointsvar language = "Swift" println("Learning\ (language)") and make sure you have the backslash the right way round
James Lambert
Courses Plus Student 14,477 PointsJames Lambert
Courses Plus Student 14,477 Pointsjust type: println("Learning " + language)
Anything you put in side the () needs to be an object or a string. You have two objects that you are trying to print to the line. The first object is going to be the string "Learning". The second object is the variable called language. You add the two together with the +