- Swift Functional Programming(Second Edition)
- Dr. Fatih Nayebi
- 57字
- 2021-07-02 23:54:25
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"