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

# subscript(_:)

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

## Declaration

```swift
subscript(indices: RangeSet<AttributedString.Index>) -> DiscontiguousAttributedSubstring { get set }
```

## Parameters

- `indices`: A set of ranges that indicate the bounds of the discontiguous substring to return.
