dropWhile method

KtList<T> dropWhile(
  1. bool predicate(
    1. T
    )
)

Returns a list containing all elements except first elements that satisfy the given predicate.

Implementation

KtList<T> dropWhile(bool Function(T) predicate) {
  var yielding = false;
  final list = mutableListOf<T>();
  for (final item in iter) {
    if (yielding) {
      list.add(item);
    } else {
      if (!predicate(item)) {
        list.add(item);
        yielding = true;
      }
    }
  }
  return list;
}