I would have expected concatenation between different types to be straightforward in Swift, but apparently not. What is the workaround for this?
var boy = "Bart Simpson"
var age = 7
print(boy + " is " + age)
very easy, wrap all printable objects in \( )
let boy = "Bart Simpson"
let age = 7
print("\(boy) is \(age)")
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With