MCPcopy Create free account
hub / github.com/Rezonality/zep / string_split_each

Function string_split_each

src/mcommon/string/stringutils.cpp:252–264  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

250}
251
252void string_split_each(const std::string& text, const char* delims, std::function<bool(size_t, size_t)> fn)
253{
254 std::size_t start = text.find_first_not_of(delims), end = 0;
255
256 while ((end = text.find_first_of(delims, start)) != std::string::npos)
257 {
258 if (!fn(start, end - start))
259 return;
260 start = text.find_first_not_of(delims, end);
261 }
262 if (start != std::string::npos)
263 fn(start, text.length() - start);
264}
265
266size_t string_first_not_of(const char* text, size_t start, size_t end, const char* delims)
267{

Callers

nothing calls this directly

Calls 4

string_first_not_ofFunction · 0.85
string_first_ofFunction · 0.85
find_first_not_ofMethod · 0.80
find_first_ofMethod · 0.80

Tested by

no test coverage detected