---
title: "filteredIndexSet(includeInteger:)"
framework: foundation
role: symbol
role_heading: Instance Method
path: "foundation/indexset/filteredindexset(includeinteger:)"
---

# filteredIndexSet(includeInteger:)

Returns an IndexSet filtered according to the result of includeInteger.

## Declaration

```swift
func filteredIndexSet(includeInteger: (IndexSet.Element) throws -> Bool) rethrows -> IndexSet
```

## Parameters

- `includeInteger`: The predicate which decides if an integer will be included in the result or not.

## See Also

### Selecting Elements

- [filteredIndexSet(in:includeInteger:)](foundation/indexset/filteredindexset(in:includeinteger:)-6cdvc.md)
- [filteredIndexSet(in:includeInteger:)](foundation/indexset/filteredindexset(in:includeinteger:)-9dn86.md)
