swift 5 string concatenation code example
Example 1: swift string concatenation
let age = 28
let name = "John"
let isAlcoholic = true
var description = "\(name) is \(age) years old and \(isAlcoholic ? "is" : "isn't") alcoholic"
Example 2: how to concatenate two strings in swift
var greet = "Hello, "
let name = "Jack"
// using + operator
var result = greet + name
print(result)
//using =+ operator
greet += name
print(greet)