MCPcopy Create free account
hub / github.com/chen3feng/toft / StringTrimRight

Function StringTrimRight

base/string/algorithm.cpp:471–477  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

469}
470
471void StringTrimRight(std::string* str)
472{
473 int end_pos = static_cast<int>(str->length()) - 1;
474 while (end_pos >= 0 && isspace(str->at(end_pos)))
475 end_pos--;
476 *str = str->substr(0, end_pos + 1);
477}
478
479std::string StringTrimRight(const StringPiece& str)
480{

Callers

nothing calls this directly

Calls 5

substrMethod · 0.80
as_stringMethod · 0.80
find_last_not_ofMethod · 0.80
lengthMethod · 0.45
clearMethod · 0.45

Tested by

no test coverage detected