Created
January 7, 2013 21:53
-
-
Save jassinm/4478841 to your computer and use it in GitHub Desktop.
This file contains hidden or 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> split(const std::string &s, const std::string &tosplit){ | |
const std::regex rsplit(tosplit + "+"); | |
auto rit = std::sregex_token_iterator(s.begin(), s.end(), rsplit, -1); | |
auto rend = std::sregex_token_iterator(); | |
auto res = std::vector<std::string>(rit, rend); | |
return res; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment