takeWhile method
Returns a list containing first elements satisfying the given predicate
.
Implementation
KtList<T> takeWhile(bool Function(T) predicate) {
final list = mutableListOf<T>();
for (final item in iter) {
if (!predicate(item)) {
break;
}
list.add(item);
}
return list;
}