HomeManualTopicsTypesSymbols

std::map_characters

applies a function to each character of the string

Parameters

self
the string which characters will be mapped
function
the function to apply to each character of the string

Results

None

Description

The function returns a string that is the result of applying the specified function to each character of the string.

Example

$str "abc" $upper_case_str map_characters(str to_upper_case) println! upper_case_str

Output

ABC

Topic

Strings

See also

std::to_upper_case converts all lower case characters to UPPER CASE
std::to_lower_case converts all upper case characters to lower case
std::to_title_case converts the contents to Title Case
std::map applies a function to all items of a collection
std::map_reduce combines a map and a reduce operation into a single operation