Created
February 27, 2020 07:21
-
-
Save ramunasjurgilas/0257247c77e46586970d29fdedb9a4bc to your computer and use it in GitHub Desktop.
dropWhile() as filtering operator
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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