rtrim#
Fully qualified name: omni::extras::rtrim
Defined in omni/extras/StringHelpers.h
- inline std::string &omni::extras::rtrim(
- std::string &s,
- const char *t = kTrimCharsDefault,
Performs an in-place right-trim on a given string.
This will trim the characters in
t
from the right side ofs
. e.g. givens
=" asdf "
with the defaultt
value,s
would be modified to contain" asdf"
. This is effectivelys.erase(s.find_last_not_of(t) + 1)
.See also
- Parameters:
s – The string to trim in-place
t – A string containing the list of characters to trim (such as kTrimCharsDefault)
- Returns:
s
for convenience