iOS ● ○ ○ Swift 6

Kodebits Day 34: String Interpolation

Jun 3 2026
Practice strings with a short swift challenge.

What does this print?

let x = 7
let y = 3
let msg = "\(x) + \(y) = \(x + y)"
print(msg)


Try it in the online Swift Playground →

[spoiler title="Solution"]

Answer:

7 + 3 = 10

Explanation:

String interpolation with `\()` evaluates expressions and inserts them into strings.

[/spoiler]


Further Reading