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 trialAmir Amiri
Courses Plus Student 102 PointsCould you please explain the answer of this challenge
This is how I wrote this:
let language = "Swift" var Amir : String = "Learning" println(amir+language)
I don't know why it's not working !!!
let language = "Swift"
var Amir : String = "Learning"
println(Amir+language)
Amir Amiri
Courses Plus Student 102 PointsActually I did and this is the error again: You need to interpolate the value of the 'language' constant into the string you pass to 'println'.
1 Answer
Holger Liesegang
50,595 PointsWelcome to Treehouse, Amir Amiri !
The error message said: "You need to interpolate the value of the 'language' constant into the string you pass to 'println'."
You can do that like this:
let language = "Swift"
println("Learning \(language)")
...also you might want to have a look at https://developer.apple.com/library/ios/documentation/Swift/Conceptual/Swift_Programming_Language/StringsAndCharacters.html at section String "Interpolation"
Shubham Batra
1,960 PointsShubham Batra
1,960 PointsThe problem is in the last line. It should be:
println(Amir + language)
There should be a space before and after the plus operator