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 trialDavid Richard
Courses Plus Student 699 PointsPrintIn Help
I'm not totally sure what this means: "You need to interpolate the value of the 'language' constant into the string you pass to 'println'. Please help me out.
let language = "Swift"
PrintIn("Learning Swift ")
2 Answers
Michael Hulet
47,913 PointsIn Swift, you can easily paste the value of a variable into a String
, without actually copy & pasting your code. This technique is called "String Interpolation". The syntax looks like this:
let language = "Swift"
printIn("Learning \(language)")
David Richard
Courses Plus Student 699 PointsThank you so much.
David Richard
Courses Plus Student 699 PointsDavid Richard
Courses Plus Student 699 PointsIt didnt seem to work. I got this: "swift_lint.swift:8:1: error: use of unresolved identifier 'printIn' printIn("Learning (language) ") ^ "
Michael Hulet
47,913 PointsMichael Hulet
47,913 PointsYou forgot the backslash in the middle of the string in the
println
statement. Feel free to copy & paste this verbatim