MCPcopy Create free account
hub / github.com/ObEngine/ObEngine / split

Function split

src/Core/Utils/StringUtils.cpp:10–22  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

8namespace obe::Utils::String
9{
10 std::vector<std::string> split(const std::string& str, const std::string& delimiters)
11 {
12 std::vector<std::string> tokens;
13 std::string::size_type lastPos = str.find_first_not_of(delimiters, 0);
14 std::string::size_type pos = str.find_first_of(delimiters, lastPos);
15 while (std::string::npos != pos || std::string::npos != lastPos)
16 {
17 tokens.push_back(str.substr(lastPos, pos - lastPos));
18 lastPos = str.find_first_not_of(delimiters, pos);
19 pos = str.find_first_of(delimiters, lastPos);
20 }
21 return tokens;
22 }
23
24 int occurencesInString(const std::string& str, const std::string& occur)
25 {

Callers 3

lastMethod · 0.50
makeCombinationMethod · 0.50
initPluginsMethod · 0.50

Calls 2

substrMethod · 0.80
push_backMethod · 0.45

Tested by

no test coverage detected