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

Abdurahman Sharif
Abdurahman Sharif
1,205 Points

how do i do this?

im confused with print and println

println.swift
let language = "Swift"
println (/ (language) + Swift)

3 Answers

Walter Somerville
Walter Somerville
20,698 Points

So as for why that won't run, you need to remove the space between the \ and the (, and wrap it all in "" like this:

let language = "Swift"
println ("/(language) Swift")

if you are just trying to concatenate the two together without using a formatted string it would look like this

let language = "Swift"
println (language + " Swift")

if you're just trying to print the word swift you can do it like

let language = "Swift"
println (language)

or

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

print and println differ primarily that println prints on a new line, and print just prints on the current line (meaning that println is more useful in most cases).

Abdurahman Sharif
Abdurahman Sharif
1,205 Points

FINALLY got it!!. thanks for your help and clarification.