dropUntil
Skips values until the predicate matches — the matching element is dropped too — then yields the rest.
Lecture
dropUntil is the drop-side counterpart to
takeUntilInclusive — and the two treat their matching
element in opposite ways. dropWhile stops dropping right
before the failing element, keeping it in the output;
dropUntil stops at the matching element and
discards it along with everything before it. Only elements strictly
after the match survive.
Use it when a marker or sentinel needs to disappear along with the
prefix it delimits — "everything after the READY line, not
including READY itself".
Demo 1 · Basics
Compare with dropWhile: here the matching element
(3 / 'STOP') does not appear in the result:
Demo 2 · Async
Try it yourself
Exercise: drop everything up to and including 'READY'.
dropWhile — keeps the matching element ·
takeUntilInclusive — the take-side counterpart ·
drop — drop by fixed count