Created
March 14, 2019 00:50
-
-
Save sailfish009/a2537844d84db83602cd68ef7a3cb0b1 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
#include <sstream> | |
#include <string> | |
std::vector<std::string> split(const std::string& s, char delimiter) | |
{ | |
std::vector<std::string> tokens; | |
std::string token; | |
std::istringstream tokenStream(s); | |
while (std::getline(tokenStream, token, delimiter)) | |
{ | |
tokens.push_back(token); | |
} | |
return tokens; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment