I need to look for suffix in reverse by some predicate, the opposite of prefix(while:)
. I thought for sure there must be a .suffix(while:)
, but no.
Will this work: .reversed().prefix(while:).reversed()
I need to look for suffix in reverse by some predicate, the opposite of prefix(while:)
. I thought for sure there must be a .suffix(while:)
, but no.
Will this work: .reversed().prefix(while:).reversed()
I think there should be a suffix(while:)
on BidirectionalCollection
and I'm quite surprised to see there isn't. In the meantime, yes, the above ought to work.