IterableSplitExtensions<T extends Object> extension

Split at index or at first element matching predicate.

on

Methods

splitAt(int index) → (List<T>, List<T>)

Available on Iterable<T>, provided by the IterableSplitExtensions extension

Splits into two lists at index. First list has elements [0..index), second index..length.
splitAtFirstWhere(ElementPredicate<T> predicate) → (List<T>, List<T>)

Available on Iterable<T>, provided by the IterableSplitExtensions extension

Splits at the first element where predicate is true. That element goes in the second list.