MCPcopy Create free account
hub / github.com/cselab/aphros / Strip

Function Strip

src/parse/parser.cpp:16–26  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

14#include "vars.h"
15
16static std::string Strip(std::string s) {
17 size_t b = 0;
18 size_t e = s.size();
19 while (b < e && std::isspace(s[b])) {
20 ++b;
21 }
22 while (b < e && std::isspace(s[e - 1])) {
23 --e;
24 }
25 return s.substr(b, e - b);
26}
27
28struct Parser::Imp {
29 using Owner = Parser;

Callers 2

CmdSetMethod · 0.70
ReadMultilineFunction · 0.70

Calls 1

sizeMethod · 0.45

Tested by

no test coverage detected