MCPcopy Create free account
hub / github.com/MeisApps/pcbu-desktop / Split

Method Split

common/src/utils/StringUtils.cpp:25–36  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

23}
24
25std::vector<std::string> StringUtils::Split(const std::string &str, const std::string &delim) {
26 size_t pos_start{}, pos_end{}, delim_len = delim.length();
27 std::string token{};
28 std::vector<std::string> res{};
29 while((pos_end = str.find(delim, pos_start)) != std::string::npos) {
30 token = str.substr(pos_start, pos_end - pos_start);
31 pos_start = pos_end + delim_len;
32 res.push_back(token);
33 }
34 res.push_back(str.substr(pos_start));
35 return res;
36}
37
38std::string StringUtils::LTrim(const std::string &str) {
39 auto result = str;

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected