---
title: "appendInterpolation(_:)"
framework: swift
role: symbol
role_heading: Instance Method
path: "swift/defaultstringinterpolation/appendinterpolation(_:)-8x6aw"
---

# appendInterpolation(_:)

Interpolates the given value’s textual representation into the string literal being created.

## Declaration

```swift
mutating func appendInterpolation<T>(_ value: T)
```

## Discussion

Discussion You don’t need to call this method directly. It’s used by the compiler when interpreting string interpolations. Instead, use string interpolation to create a new string by including values, literals, variables, or expressions enclosed in parentheses, prefixed by a backslash (\(…)). let price = 2 let number = 3 let message = """               If one cookie costs \(price) dollars, \               \(number) cookies cost \(price * number) dollars.               """ print(message) // Prints "If one cookie costs 2 dollars, 3 cookies cost 6 dollars."
