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 Strings

Sam Katz
Sam Katz
2,986 Points

We know we need to use (()) but can't tell what to do afterwards. It seems to require a very specific syntax

none needed


15,478 Points

Sam: Can you be more specific about the problem, or what you are referring to exactly?

1 Answer

Dan Hillman
Dan Hillman
4,394 Points

The new line syntax does not need the parentheses, you just insert the \n where you would like a new line to start. The back slash \ is used to tell the compiler that there is something there that does not need to be printed literally, and it usually refers to a variable, constant, or specific syntax like in this example.

println("Bread \n Milk \n Honey")