Created
June 5, 2018 21:40
-
-
Save fxfactorial/ee30fb0d6b469daba79353207e863ee0 to your computer and use it in GitHub Desktop.
boost::split example
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
#include <boost/algorithm/string.hpp> | |
#include <string> | |
#include <vector> | |
#include <iostream> | |
int main() | |
{ | |
std::string splitMe = "aa,b,cc,d"; | |
std::vector<std::string> tokens; | |
boost::algorithm::split(tokens, splitMe, boost::is_any_of(",")); | |
for (auto token : tokens) | |
{ | |
std::cout << token << std::endl; | |
} | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment