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

# indexRange(in:)

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

## Declaration

```swift
func indexRange(in range: Range<IndexSet.Element>) -> Range<IndexSet.Index>
```

## 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. The resulting range will be isEmpty if the intersection is empty.

## See Also

### Manipulating Indexes

- [startIndex](foundation/indexset/startindex.md)
- [endIndex](foundation/indexset/endindex.md)
- [index(after:)](foundation/indexset/index(after:).md)
- [index(before:)](foundation/indexset/index(before:).md)
- [formIndex(after:)](foundation/indexset/formindex(after:).md)
- [formIndex(before:)](foundation/indexset/formindex(before:).md)
