uce/site/doc/pages/2_StringList_map.txt
2026-06-16 12:21:31 +00:00

21 lines
541 B
Plaintext

:sig
template<typename F> StringList StringList::map(F f) const
:params
f : mapper called with each string
return value : new list of mapped strings
:content
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");
:see
>types
0_StringList
2_StringList_filter
2_StringList_each