filterNotNull

Returns a list of non-null elements in their original iteration order.

Creates a new list and narrows the element type to non-null. The retained values are not copied. Exceptions from iteration propagate to the caller.

Receiver

elements to visit in their iteration order.

Return

a new read-only list excluding nulls; empty if there are no non-null elements.

See also