Skip to content

Instantly share code, notes, and snippets.

@goelakash
Created January 23, 2016 16:32
Show Gist options
  • Save goelakash/8d29a517e8e5ee1d96d0 to your computer and use it in GitHub Desktop.
Save goelakash/8d29a517e8e5ee1d96d0 to your computer and use it in GitHub Desktop.
Tokenize string (C++)
vector<string> tokenize(string str)
{
vector<string> vec;
string word;
istringstream iss(str, istringstream::in);
while( iss >> word )
{
vec.push_back(word);
}
return vec;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment