快速打印,无需换行 [英] print without newline in swift
本文介绍了快速打印,无需换行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在swift 2.0中,print()
自动添加换行符.在Swift 1.2中,println()
和print()
曾经是独立的功能.因此,我如何打印一些文本而不在其中添加换行符,因为swift不再具有不追加换行符的打印功能.
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.
推荐答案
从Swift 2.0开始,推荐的不带换行符的打印方法是:
Starting in Swift 2.0, the recommended method of printing without newline is:
print("Hello", terminator:"")
这篇关于快速打印,无需换行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文