UCE Docs / StringList::map

Signature

template StringList StringList::map(F f) const

Parameters

f : mapper called with each string
return value : new list of mapped strings

Returns a new StringList containing the mapper result for each item, in the same order. Use it for simple string transformations while keeping list shape.

Example

StringList names = split("ada,grace", ",");
StringList upper = names.map([](String item) { return(to_upper(item)); });
print(join(upper, ","), "\n");
Output
ADA,GRACE