---
title: "subscript(_:)"
framework: foundation
role: symbol
role_heading: Instance Subscript
path: "foundation/attributedstring/subscript(_:)-2vqsz"
---

# subscript(_:)

Returns a substring of the attributed string using a range to indicate the substring bounds.

## Declaration

```swift
subscript(bounds: some RangeExpression<AttributedString.Index>) -> AttributedSubstring { get set }
```
