1std::stringstream test("this_is_a_test_string");
2std::string segment;
3std::vector<std::string> seglist;
4
5while(std::getline(test, segment, '_'))
6{
7 seglist.push_back(segment); //Spit string at '_' character
8}
1#include <boost/algorithm/string.hpp>
2
3std::string text = "Let me split this into words";
4std::vector<std::string> results;
5
6boost::split(results, text, [](char c){return c == ' ';});