48string_token(std::vector<std::string>& substrings,
const std::string& text,
49 const std::string& delims =
",")
51 std::string::size_type
len = text.length();
52 std::string::size_type pos = 0;
53 std::string::size_type next;
56 next = std::string::npos;
58 next = text.find_first_of(delims, pos);
59 std::string::size_type sublen =
60 (next == std::string::npos) ?
len - pos : next - pos;
61 std::string ss = text.substr(pos, sublen);
62 substrings.push_back(
trim(ss));
65 while (next != std::string::npos);
void string_token(std::vector< std::string > &substrings, const std::string &text, const std::string &delims=",")
Split a string up into a vector of substrings delimited by commas.
Definition string_token.h:48