---
title: "filter(_:)"
framework: swift
role: symbol
role_heading: Instance Method
path: "swift/substring/filter(_:)"
---

# filter(_:)

## Declaration

```swift
func filter<E>(_ isIncluded: (Substring.Element) throws(E) -> Bool) throws(E) -> String where E : Error
```
