span method

(Iterable<T>, Iterable<T>) span(
  1. bool test(
    1. T t
    )
)

Return a record where first element is longest prefix (possibly empty) of this Iterable with elements that satisfy test and second element is the remainder of the Iterable.

Implementation

(Iterable<T>, Iterable<T>) span(bool Function(T t) test) =>
    (takeWhile(test), skipWhile(test));