MCPcopy Create free account
hub / github.com/cinit/TMoe / splitString

Method splitString

app/src/main/cpp/utils/TextUtils.cpp:28–43  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

26}
27
28std::vector<std::string> utils::splitString(const std::string &str, const std::string &splits) {
29 std::vector<std::string> res;
30 if (str.empty()) {
31 return res;
32 }
33 std::string strs = str + splits;
34 size_t pos = strs.find(splits);
35 size_t step = splits.size();
36 while (pos != std::string::npos) {
37 std::string temp = strs.substr(0, pos);
38 res.push_back(temp);
39 strs = strs.substr(pos + step, strs.size());
40 pos = strs.find(splits);
41 }
42 return res;
43}

Callers

nothing calls this directly

Calls 1

sizeMethod · 0.45

Tested by

no test coverage detected