Filter strings
lib callCapy
function filter(items : any, predicate : function(value : string) bool) any
Description
filter keeps the strings for which predicate returns true.
The result keeps input order. This function does not change items.
Return Values
This function returns a new list-shaped any.
Example
Capy
var items := split("one,two", ",")
var kept := filter(items, function(value : string) bool { return value == "two" })
print(join(kept, ","), "\n")
Output
two