MCPcopy Create free account
hub / github.com/CodingGay/BlackDex / Split

Function Split

Bcore/src/main/cpp/android-base/strings.cpp:31–47  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

29 if ((a) == (b)) abort();
30
31std::vector<std::string> Split(const std::string& s,
32 const std::string& delimiters) {
33 CHECK_NE(delimiters.size(), 0U);
34
35 std::vector<std::string> result;
36
37 size_t base = 0;
38 size_t found;
39 while (true) {
40 found = s.find_first_of(delimiters, base);
41 result.push_back(s.substr(base, found - base));
42 if (found == s.npos) break;
43 base = found + 1;
44 }
45
46 return result;
47}
48
49std::string Trim(const std::string& s) {
50 std::string result;

Callers 1

InitLoggingFunction · 0.70

Calls 2

sizeMethod · 0.45
substrMethod · 0.45

Tested by

no test coverage detected