MCPcopy Create free account
hub / github.com/approvals/ApprovalTests.cpp / rightTrim

Method rightTrim

ApprovalTests/utilities/StringUtils.cpp:69–78  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

67 }
68
69 APPROVAL_TESTS_NO_DISCARD
70 std::string StringUtils::rightTrim(std::string s)
71 {
72 s.erase(std::find_if(s.rbegin(),
73 s.rend(),
74 [](unsigned char ch) { return !std::isspace(ch); })
75 .base(),
76 s.end());
77 return s;
78 }
79
80 APPROVAL_TESTS_NO_DISCARD
81 std::string StringUtils::trim(std::string s)

Callers

nothing calls this directly

Calls 1

find_ifFunction · 0.85

Tested by

no test coverage detected