takeWhile

abstract fun takeWhile(predicate: Predicate<TextElement>): List<TextElement>(source)

Returns a new list containing elements from the start until the predicate fails. The returned list is independent of this sequence.

Return

a new list of matching elements

Parameters

predicate

the condition to test

Throws

if predicate is null