Avatar
@swift-5.0.3 @swift-main extension String.StringInterpolation { mutating func appendInterpolation<T>(_ val: T?, default defaultValue: String) { if let val = val { appendInterpolation(val) } else { defaultValue.write(to: &self) } } } let value: Int? = nil print("The value is: \(value, default: "<nil>")")