Reputation: 819
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(str)
print(strs, separator: ",", terminator: "")
print(str, separator: ",", terminator: "\n")
Upvotes: 2
Views: 1192
Reputation: 11
print ("rob" ,"mark" , "hanna" , separator:"$") // prints rob$mark$hanna
To use separator we need to pass multiple string inside print function.
Upvotes: 0
Reputation: 118691
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:
print(strs.joinWithSeparator(","))
Upvotes: 4