HomeManualTopicsTypesSymbols

std::trim

removes leading and trailing whitespace

Parameters

self
test (default: is_a_whitespace_character)

Results

None

Description

Returns a string which is the specified string without any leading or trailing whitespace.

Example

$str " text " $trimmed_str trim(str) println! '*' trimmed_str '*'

Output

*text*

Topic

Strings

See also

std_types::string/std::trim_left
std_types::string/std::trim_right
std_types::string/std::normalize