---
title: "insert(_:at:)"
framework: foundation
role: symbol
role_heading: Instance Method
path: "foundation/attributedstring/insert(_:at:)"
---

# insert(_:at:)

Inserts the specified string at a specific index in the attributed string.

## Declaration

```swift
mutating func insert(_ s: some AttributedStringProtocol, at index: AttributedString.Index)
```

## Parameters

- `s`: The string to insert.
- `index`: The index that indicates where to insert the string.

## See Also

### Modifying an Attributed String

- [AttributedString.Index](foundation/attributedstring/index.md)
- [removeSubrange(_:)](foundation/attributedstring/removesubrange(_:).md)
- [replaceSubrange(_:with:)](foundation/attributedstring/replacesubrange(_:with:).md)
