---
title: "drop(while:)"
framework: swift
role: symbol
role_heading: Instance Method
path: "swift/string/unicodescalarview/drop(while:)"
---

# drop(while:)

Returns a subsequence by skipping elements while predicate returns true and returning the remaining elements.

## Declaration

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

## Parameters

- `predicate`: A closure that takes an element of the sequence as its argument and returns true if the element should be skipped or false if it should be included. Once the predicate returns false it will not be called again.

## Discussion

Discussion note: O(n), where n is the length of the collection.
