Returns a new map containing only entries that match the predicate.
Example:
var map = new HashMap<string, string> (GLib.str_hash, GLib.str_equal);
map.put ("name", "Alice");
map.put ("age", "30");
map.put ("note", "");
var filtered = Maps.filterString (map, (k, v) => {
return v.length > 0;
});
// filtered contains only "name" and "age"
| map |
the source map. |
| fn |
the predicate taking key and value. |
|
a new filtered HashMap. |