21 lines
541 B
Plaintext
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
|