#include #include // // splits string s to vector v, using separator character sep // return value: v // It seems that it follows the python implementation of split() // std::vector split(std::vector &v, const std::string s, const char sep) { v.clear(); for (size_t p=0, q=0; q != s.npos; p = q + 1) v.push_back(s.substr(p,(q=s.find(sep,p))-p)); return v; } #if 0 #include int main() { char sep = '/'; std::string s="/version/command/ /modifier/"; std::vector v; v=split(v,s,sep); for (unsigned i=0; i