---
title: "indexRange(in:)"
framework: foundation
role: symbol
role_heading: Instance Method
path: "foundation/indexset/indexrange(in:)-6057o"
---

# indexRange(in:)

Return a Range<IndexSet.Index> which can be used to subscript the index set.

## Declaration

```swift
func indexRange<R>(in range: R) -> Range<IndexSet.Index> where R : RangeExpression, R.Bound == Int
```

## Parameters

- `range`: The range of integers to include.

## Discussion

Discussion The resulting range is the range of the intersection of the integers in range with the index set.
