MCPcopy Create free account
hub / github.com/csmith-project/csmith / split_string

Method split_string

src/StringUtils.cpp:114–131  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

112}
113
114void
115StringUtils::split_string(const string str, vector<string> &v, const char sep_char)
116{
117 size_t pos = 0;
118 size_t start_pos = 0;
119 while(true) {
120 ignore_spaces(str, pos);
121 start_pos = pos;
122 pos = str.find_first_of(sep_char, pos);
123 std::string s = str.substr(start_pos, (pos - start_pos));
124 if (!s.empty()) {
125 v.push_back(s);
126 }
127 if (pos == string::npos)
128 break;
129 pos++;
130 }
131}
132
133void
134StringUtils::split_string(const string str, vector<string> &v, string sep_chars)

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected