UCE Docs / StringList::every

Signature

template bool StringList::every(F f) const

Parameters

f : predicate called with each string
return value : true when every item matches

Tests whether all strings in the list satisfy the predicate. Use it for validation checks where a list is acceptable only if every member passes the same rule.

Example

StringList routes = split("dashboard,index,themes", ",");
bool all_named = routes.every([](String item) { return(item != ""); });
print(all_named ? "all named\n" : "missing name\n");
Output
all named