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

halimat yusuf
halimat yusuf
2,290 Points

Given the constant named language, write a println statement which will print the following string: i'm stuck help i

Given the constant named language, write a println statement which will print the following string: "Learning Swift".

Use the language constant within the string you pass to your println statement. Practice using string interpolation. i've watched the video over and over again but i still don't get it

println.swift
let language = "Swift"
halimat yusuf
halimat yusuf
2,290 Points

thanks but i'm still stuck ' Please practice using string interpolation to use the value of the 'language' constant in the string that is passed to 'println'.' this is what it says

1 Answer

Hi Halimat,

With string interpolation you can merge together strings you want to say the same with something that might be a variable or a constant from elsewhere in your code (say as the result of a function). You could try something like this:

println("Learning \(language)") // this will use whatever you have declared as the language constant.

If xcode complains about println, try print instead - newer versions of swift only allow the latter. If you want to include a new line after your statement you'll need to add the appendNewline parameter.