MCPcopy Create free account
hub / github.com/Notgnoshi/generative / trim

Function trim

generative/io/tgf-graph-reader.cpp:50–62  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

48}
49
50static std::string trim(const std::string& str, const std::string& whitespace = " \t\n")
51{
52 const auto str_begin = str.find_first_not_of(whitespace);
53 if (str_begin == std::string::npos)
54 {
55 return ""; // no content
56 }
57
58 const auto str_end = str.find_last_not_of(whitespace);
59 const auto str_range = str_end - str_begin + 1;
60
61 return str.substr(str_begin, str_range);
62}
63
64void TGFGraphReader::read_node(const std::string& _line) noexcept
65{

Callers 2

read_nodeMethod · 0.85
read_edgeMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected