---
title: "subscript(_:)"
framework: foundation
role: symbol
role_heading: Instance Subscript
path: "foundation/discontiguousattributedsubstring/subscript(_:)-6j670"
---

# subscript(_:)

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

## Declaration

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

## Parameters

- `bounds`: A range that indicates the bounds of the discontiguous substring to return.
