---
title: AttributedString.Index
framework: foundation
role: symbol
role_heading: Structure
path: foundation/attributedstring/index
---

# AttributedString.Index

A type that represents the position of a character or code unit within an attributed string.

## Declaration

```swift
struct Index
```

## Topics

### Initializers

- [init(_:within:)](foundation/attributedstring/index/init(_:within:).md)

### Instance Methods

- [isValid(within:)](foundation/attributedstring/index/isvalid(within:)-6wjr6.md)
- [isValid(within:)](foundation/attributedstring/index/isvalid(within:)-8fw50.md)

## Relationships

### Conforms To

- [Comparable](swift/comparable.md)
- [Equatable](swift/equatable.md)
- [Sendable](swift/sendable.md)
- [SendableMetatype](swift/sendablemetatype.md)

## See Also

### Modifying an Attributed String

- [insert(_:at:)](foundation/attributedstring/insert(_:at:).md)
- [removeSubrange(_:)](foundation/attributedstring/removesubrange(_:).md)
- [replaceSubrange(_:with:)](foundation/attributedstring/replacesubrange(_:with:).md)
