filter

filter reporter-task list

Reports a list containing only those items of list for which the task reports true -- in other words, the items satisfying the given condition.

show filter is-number? [1 "2" 3]
=> [1 3]
show filter [? < 3] [1 3 2]
=> [1 2]
show filter [first ? != "t"] ["hi" "there" "everyone"]
=> ["hi" "everyone"]

See also map, reduce, ?.

Take me to the full NetLogo Dictionary