Enum

split_while/2

split_while(enumerable, fun)

Splits enumerable in two at the position of the element for which fun returns a falsy value (false or nil) for the first time.