Created
December 9, 2010 18:04
-
-
Save shnya/735072 to your computer and use it in GitHub Desktop.
C++ split: copy, istream_iteartor, back_inserter version
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
vector<string> split(const string &str){ | |
istringstream iss(str); vector<string> res; | |
copy(istream_iterator<string>(iss), istream_iterator<string>(), back_inserter(res)); | |
return res; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment