MCPcopy Create free account
hub / github.com/cppcheck-opensource/cppcheck / trim

Function trim

lib/utils.cpp:131–138  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

129}
130
131std::string trim(const std::string& s, const std::string& t)
132{
133 const std::string::size_type beg = s.find_first_not_of(t);
134 if (beg == std::string::npos)
135 return "";
136 const std::string::size_type end = s.find_last_not_of(t);
137 return s.substr(beg, end - beg + 1);
138}
139
140void findAndReplace(std::string &source, const std::string &searchFor, const std::string &replaceWith)
141{

Callers 4

parseCommentMethod · 0.85
analyseClangTidyMethod · 0.85
hasEmacsCppMarkerFunction · 0.85
trimMethod · 0.85

Calls

no outgoing calls

Tested by 1

trimMethod · 0.68