Skip to content

Instantly share code, notes, and snippets.

@shnya
Created December 9, 2010 18:04
Show Gist options
  • Save shnya/735070 to your computer and use it in GitHub Desktop.
Save shnya/735070 to your computer and use it in GitHub Desktop.
C++ split: stringstream version
vector<string> split(const string &str, char delim){
istringstream iss(str); string tmp; vector<string> res;
while(getline(iss, tmp, delim)) res.push_back(tmp);
return res;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment