MCPcopy Create free account
hub / github.com/dmlc/parameter_server / split

Function split

src/util/split.h:9–18  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

7// split("one:two::three", ':'); will return 4 items
8
9inline std::vector<std::string>
10split(const std::string &s, char delim, bool skip_empty = false) {
11 std::vector<std::string> elems;
12 std::stringstream ss(s);
13 string item;
14 while (std::getline(ss, item, delim))
15 if (!(skip_empty && item.empty()))
16 elems.push_back(item);
17 return elems;
18}
19
20// TODO support bool skip_empty = false
21inline std::string join(const std::vector<std::string> &elems, const string& delim) {

Callers 4

readFilenamesInDirectoryFunction · 0.85
getFilenameFunction · 0.85
getPathFunction · 0.85
removeExtensionFunction · 0.85

Calls 1

emptyMethod · 0.45

Tested by

no test coverage detected