Created
March 14, 2018 15:12
-
-
Save seanwu1105/f8d81e998e273c360203b94300117a73 to your computer and use it in GitHub Desktop.
Split the string line by normal delimiters. Returns a vector containing all words in it.
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
std::vector<std::string> SplitLine(const std::string &line) | |
{ | |
std::vector<std::string> tokens; | |
std::stringstream ss(line); | |
copy(std::istream_iterator<std::string>(ss), | |
std::istream_iterator<std::string>(), | |
back_inserter(tokens)); | |
return tokens; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment