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.
This was also part of the consumers/searchers prototype from way back when, and Swift Algorithms is also starting to fill in these kinds of gaps too. CC @nnnnnnnn @timv
Yep! suffix(while:)
was added to the Algorithms package in version 0.0.3.