#ifndef ADVENT_DVEREB_SPLITSTR_H #define ADVENT_DVEREB_SPLITSTR_H #include #include std::vector SplitStr(std::string str, const std::string &delim) { std::vector rtn; for(auto split = str.find(delim); split != std::string::npos; split = str.find(delim)) { rtn.push_back(str.substr(0, split)); str = str.substr(split + delim.size()); // chop off beginning } if(str.size()) rtn.push_back(str); return rtn; } #endif