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