7 std::vector<std::string>
8 tokenize(
const std::string & str,
const std::string & delimiters)
10 std::vector<std::string> tokens;
13 std::string::size_type lastPos = str.find_first_not_of(delimiters, 0);
16 std::string::size_type pos = str.find_first_of(delimiters, lastPos);
18 while (std::string::npos != pos || std::string::npos != lastPos)
21 tokens.push_back(str.substr(lastPos, pos - lastPos));
24 lastPos = str.find_first_not_of(delimiters, pos);
27 pos = str.find_first_of(delimiters, lastPos);
33 #endif // CPPTOKENIZER_H