MCPcopy Create free account
hub / github.com/bcndev/bytecoin / extract

Function extract

src/common/StringTools.cpp:123–134  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

121}
122
123std::string extract(std::string &text, char delimiter) {
124 size_t delimiter_pos = text.find(delimiter);
125 std::string sub_text;
126 if (delimiter_pos != std::string::npos) {
127 sub_text = text.substr(0, delimiter_pos);
128 text = text.substr(delimiter_pos + 1);
129 } else {
130 sub_text.swap(text);
131 }
132
133 return sub_text;
134}
135
136std::string extract(const std::string &text, char delimiter, size_t &offset) {
137 size_t delimiter_pos = text.find(delimiter, offset);

Callers

nothing calls this directly

Calls 1

sizeMethod · 0.45

Tested by

no test coverage detected