MCPcopy Create free account
hub / github.com/andysworkshop/stm32plus / trimRight

Function trimRight

lib/include/string/StdStringUtil.h:42–50  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

40 */
41
42 inline void trimRight(std::string& str,const char *trimChars=defaultTrimChars) {
43
44 std::string::size_type pos;
45
46 if((pos=str.find_last_not_of(trimChars))==std::string::npos)
47 str.clear();
48 else if(pos!=str.size()-1)
49 str=str.substr(0,pos+1);
50 }
51
52
53 /**

Callers 2

trimFunction · 0.85
appendPathMethod · 0.85

Calls 2

clearMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected