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

Michael Bates
Michael Bates
13,344 Points

Trouble with interpolation in Swift

I am having trouble understanding interpolation in Swift. How do I go about writing it? Thanks!

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

3 Answers

Jhoan Arango
Jhoan Arango
14,575 Points

Hello:

String interpolation has to go inside the quotes..

var someVar = "Anything that goes in here \(including interpolation) will be a string" 

// Your challenge 

let language = "Swift"
println("Learning \(language)")

Good luck

Piotr Nejman
Piotr Nejman
3,374 Points

First of all you need to use println() Interpolation - println("some text goes here (var or let)")

let language = "Swift"
println("Learning \(language)")
Michael Bates
Michael Bates
13,344 Points

Ahhhh.... It seems my placement is incorrect and I have too many parentheses and quote marks. Thanks!