MCPcopy Create free account
hub / github.com/MiniZinc/MiniZincIDE / split

Function split

cp-profiler/src/cpprofiler/utils/string_utils.cpp:14–33  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

12{
13
14vector<string> split(const string &str, char delim,
15 bool include_empty)
16{
17
18 std::stringstream ss;
19 ss.str(str);
20 std::string item;
21
22 vector<string> result;
23
24 auto inserter = std::back_inserter(result);
25
26 while (std::getline(ss, item, delim))
27 {
28 if (!item.empty() || include_empty)
29 *(inserter++) = item;
30 }
31
32 return result;
33}
34
35string join(const vector<string>& strs, char sep) {
36 std::stringstream ss;

Callers 4

getLocationFunction · 0.85
initializeMethod · 0.85
getHeatMapUrlFunction · 0.85
getPathPairFunction · 0.85

Calls 1

strMethod · 0.80

Tested by

no test coverage detected