1
在它说 的official swift document“的print(_:separator:terminator:)
函数是一个全局函数,打印一个或更值,以适当的输出。”错误时尝试打印两个值
var welcomeMessage = "Hello"
var friendlyWelcom = "Hello!"
print(friendlyWelcom, separator: ",", terminator: "", welcomeMessage, separator: ",", terminator: "") // Why this is not working
问题正如代码中的注释 - 为什么print(friendlyWelcom, welcomeMessage)
和print(friendlyWelcom, separator: ",", terminator: ""
工作但print(friendlyWelcom, separator: ",", terminator: "", welcomeMessage, separator: ",", terminator: "")
生成编译器错误?
感谢您的解释,现在对我来说这很清楚。 – SLN