UCE Docs / StringList::filter

Signature

template StringList StringList::filter(F f) const

Parameters

f : predicate called with each string
return value : new list containing items where f(item) is true

Returns a new StringList containing the original items for which the predicate returns true. Order is preserved.

Example

StringList routes = split("home,admin,docs", ",");
StringList visible = routes.filter([](String item) { return(item != "admin"); });
print(join(visible, ","), "\n");
Output
home,docs