Is there a way to filter a list with a predicate, ...
# announcements
p
Is there a way to filter a list with a predicate, but return 2 lists, one containing the matches, and another containing the non-matching elements?
a
Copy code
val a = listOf(1, 2, 3, 4, 5, 6, 7, 8, 9, 10)


a.partition {
    it % 2 == 0
}
­čĹŹ 1
p
thanks!