MCPcopy Create free account
hub / github.com/docopt/docopt.cpp / trim

Function trim

docopt_util.h:36–48  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

34 }
35
36 std::string trim(std::string&& str,
37 const std::string& whitespace = " \t\n")
38 {
39 const auto strEnd = str.find_last_not_of(whitespace);
40 if (strEnd==std::string::npos)
41 return {}; // no content
42 str.erase(strEnd+1);
43
44 const auto strBegin = str.find_first_not_of(whitespace);
45 str.erase(0, strBegin);
46
47 return std::move(str);
48 }
49
50 std::vector<std::string> split(std::string const& str, size_t pos = 0)
51 {

Callers 1

parse_sectionFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected