24std::vector<std::string>
splitString(
const std::string& str,
const std::string& delimiter,
bool preserve_empty)
26 std::vector<std::string> parts;
28 size_t end = str.find(delimiter);
29 while (end != std::string::npos)
31 parts.push_back(str.substr(start, end - start));
32 start = end + delimiter.length();
33 end = str.find(delimiter, start);
36 parts.push_back(str.substr(start));
40 parts.erase(std::remove(parts.begin(), parts.end(),
""), parts.end());
std::vector< std::string > splitString(const std::string &str, const std::string &delimiter, bool preserve_empty=true)
Split a string into multiple tokens using a specific delimiter string (Delimiter may consist of multi...