is there a collection method that returns all elements of a list before the last time a predicate is...
c
is there a collection method that returns all elements of a list before the last time a predicate is true? something like
[1,2,3,4,5,4,6].takeUntilLast { it == 4}
results in
[1,2,3,4,5,4]
r
is this just
list.dropLastWhile { !pred(it) }
?
c
hmm, it seems that it is. thanks.
r
np