aotian16 aotian16 - 10 months ago 64
Swift Question

how to use separator param of print in swift2

Sorry for newbee question.

I really do not know how to use separator param in print

var str = "Hello, playground"
var strs = ["abc","def"]

print(strs, separator: ",", terminator: "")
print(str, separator: ",", terminator: "\n")


print accepts its arguments separately, so you can do this:

print("abc", "def", separator: ",")

But you have an array of strings, so you should do this: