Skip to content

LengthWhile

Returns the length of the longest prefix for which a predicate holds.

$ wo 'LengthWhile[{2, 4, 6, 7, 8}, EvenQ]'
3