func greetingMessage(name:String,message:String)->String{
return "Greeting message is \(message) for name\(name)"
}
以上代码打印消息:"这是消息=> ,对于nameJohn"
,问候消息是Hello println("This was the message => ",greetingMessage("John", message: "Hello"))
这里的问题是","字符。如何修改它以使其不会出现在输出中?
感谢。
答案 0 :(得分:2)
尝试
println("This was the message => " + greetingMessage("John", message: "Hello"))
答案 1 :(得分:1)
func greetingMessage(name: String, message: String) -> String {
return "Greeting message is \(message) for name \(name)"
}
println("This was the message => " + greetingMessage("John", "Hello"))