MCPcopy Create free account
hub / github.com/Tencent/phxqueue / StrSplitList

Function StrSplitList

phxqueue/comm/utils/string_util.cpp:28–40  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

26
27
28void StrSplitList(const string &str, const string &delimiters, vector<std::string> &results) {
29 results.clear();
30 auto last = 0;
31 auto found = str.find_first_of(delimiters);
32 while (string::npos != found) {
33 auto r = str.substr(last, found - last);
34 last = found + 1;
35 found = str.find_first_of(delimiters, last);
36 if (!r.empty()) results.push_back(r);
37 }
38 auto r = str.substr(last);
39 if (!r.empty()) results.push_back(r);
40}
41
42
43} // namespace utils

Callers 1

RebuildMethod · 0.50

Calls

no outgoing calls

Tested by

no test coverage detected