std::vector<std::string> tokenize(std::string str) {
std::vector<std::string> tokens;
/*
// trying to figure out how to split the string up into individual token strings
//
*/
return tokens;
}
void testFunc() {
std::string text= " smoker coffee";
std::vector<std::string> tokens = tokenize(text);
for (std::string s : tokens) {
std::cout << s << std::endl;
}
}
output:
smoker
coffee
I've tried using std::getline(...) as suggested here How to split a file lines with space and tab differentiation?
but, I don't think it worked right and was tripping up over whether or not I was using the '\t' character as a delimiter correctly.