MCPcopy Create free account
hub / github.com/0xShug0/audio.cpp / trim

Function trim

app/server/http.cpp:44–49  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

42 return value;
43}
44
45std::string trim(std::string value) {
46 auto is_space = [](unsigned char ch) { return std::isspace(ch) != 0; };
47 value.erase(value.begin(), std::find_if(value.begin(), value.end(), [&](char ch) { return !is_space(ch); }));
48 value.erase(std::find_if(value.rbegin(), value.rend(), [&](char ch) { return !is_space(ch); }).base(), value.end());
49 return value;
50}
51
52std::string json_quote(std::string_view value) {

Callers 1

read_http_requestFunction · 0.70

Calls 3

eraseMethod · 0.45
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected