Skip to content

Instantly share code, notes, and snippets.

@ramunasjurgilas
Created February 27, 2020 07:21
Show Gist options
  • Save ramunasjurgilas/0257247c77e46586970d29fdedb9a4bc to your computer and use it in GitHub Desktop.
Save ramunasjurgilas/0257247c77e46586970d29fdedb9a4bc to your computer and use it in GitHub Desktop.
dropWhile() as filtering operator
import Combine
["a0", "a1", "b2", "a3", "c4", "a5", "d6"]
.publisher
.drop(while: { $0.hasPrefix("a") })
.sink { print($0) }
// Output:
// b2
// a3
// c4
// a5
// d6
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment