I have just started out in swift and i have been practising it for awhile. But often when i am printing a statement such as "Hello World" in the playground, it shows it as "Hello World\n". I am not sure why. Please do help me out with this.
This is my very own question. I couldn't find answers and so I decided to ask out in the community.
does print the value it receives as param + a new line character
"Hello world" + "\n" -> "Hello world\n"
If you don't want the
\n at the end you can tell the print function to omit it
print("Hello world", terminator: "")