---
title: "trimmingPrefix(while:)"
framework: swift
role: symbol
role_heading: Instance Method
path: "swift/anyregexoutput/trimmingprefix(while:)"
---

# trimmingPrefix(while:)

## Declaration

```swift
func trimmingPrefix(while predicate: (Self.Element) throws -> Bool) rethrows -> Self.SubSequence
```
