Reputation: 3850
func greetingMessage(name:String,message:String)->String{
return "Greeting message is \(message) for name\(name)"
}
The above code prints the message : "This was the message => , Greeting message is Hello for nameJohn"
println("This was the message => ",greetingMessage("John", message: "Hello"))
The problem here is the "," character. How do I modify this so that it doesn't appear in the output ?
Thanks.
Upvotes: 2
Views: 3795
Reputation: 2843
func greetingMessage(name: String, message: String) -> String {
return "Greeting message is \(message) for name \(name)"
}
println("This was the message => " + greetingMessage("John", "Hello"))
Upvotes: 1
Reputation: 10505
Try
println("This was the message => " + greetingMessage("John", message: "Hello"))
Upvotes: 2