Returns a new ArrayList containing only the elements that match the given predicate.
Example:
var list = new ArrayList<string> (GLib.str_equal);
list.add ("apple");
list.add ("banana");
var a_words = list.filter ((s) => { return s.has_prefix ("a"); });
assert (a_words.size () == 1);
| func |
the predicate to test each element. |
|
a new ArrayList with matching elements. |