TrimString
is an existing alternative. ~I patterned TrimRight
after it.~
Note TrimString
~and TrimRight
~ uses " \f\n\r\t\v"
as the pattern, which is consistent with the default behavior of std::isspace
.
https://en.cppreference.com/w/cpp/string/byte/isspace