Skip to main content

List.filter

filterfilter

Group: Selections

Documentation

Selects all elements of this list which satisfy a condition.

Arguments

  • filter: The filter to apply to the list. It can either be an instance of Filter_Condition or a predicate taking a value and returning a boolean value indicating whether the corresponding element should be kept or not.

Examples

Selecting all elements that are less than 3.

      import Standard.Examples

example_filter = Examples.list.filter (< 3)
example_filter = Examples.list.filter (..Less than=3)