上QQ阅读APP看书,第一时间看更新
String interpolation
String interpolation is a way to construct a new String value from a mix of constants, variables, literals, and expressions by including their values inside a String literal. Consider the following example:
let multiplier = 3
let message = "\(multiplier) times 7.5 is \(Double (multiplier) * 7.5)"
// message is "3 times 2.5 is 22.5"