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 (retired) Types Printing Results

PrintIn 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.

println.swift
let language = "Swift"
PrintIn("Learning Swift ")

2 Answers

Michael Hulet
Michael Hulet
47,913 Points

In 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)")

It didnt seem to work. I got this: "swift_lint.swift:8:1: error: use of unresolved identifier 'printIn' printIn("Learning (language) ") ^ "

Michael Hulet
Michael Hulet
47,913 Points

You forgot the backslash in the middle of the string in the println statement. Feel free to copy & paste this verbatim

Thank you so much.