print without newline in swift

Ankit Goel picture Ankit Goel · Jun 16, 2015 · Viewed 69.9k times · Source

In swift 2.0, print() automatically adds a newline character. In swift 1.2, println() and print() used to be separate functions. So how do I print some text and not add a newline to it since swift no longer has a print function that does not append newlines.

Answer

cheniel picture cheniel · Aug 28, 2015

Starting in Swift 2.0, the recommended method of printing without newline is:

print("Hello", terminator:"")