最常用的是print(items: Any...)。调用这个函数时,可传递多个字符串实参。打印到控制台上时,这些参数以空格来分隔,并以换行加回车作为终结符。
如果我们想自定义打印的分隔符与终结符,那么可以使用:print(_items:Any...,separator:String,terminator:String)
例如:
print("chinese","is my first language")
print("chinese","my first langguage", separator:" == ", terminator:" >>>>")
print("me too")
打印结果:
chinese is my first language
chinese == my first langguage >>>>me too
网友评论