cleanup, docs
This commit is contained in:
@@ -2,16 +2,19 @@
|
||||
template<typename F> StringList StringList::map(F f) const
|
||||
|
||||
:params
|
||||
f : mapper called with each String
|
||||
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
|
||||
|
||||
:content
|
||||
Returns a new `StringList` containing the mapper result for each item, in the same order.
|
||||
|
||||
```cpp
|
||||
StringList upper = names.map([](String s) { return(to_upper(s)); });
|
||||
```
|
||||
2_StringList_each
|
||||
|
||||
Reference in New Issue
Block a user