Skip to content

Instantly share code, notes, and snippets.

@fxfactorial
Created June 5, 2018 21:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fxfactorial/ee30fb0d6b469daba79353207e863ee0 to your computer and use it in GitHub Desktop.
Save fxfactorial/ee30fb0d6b469daba79353207e863ee0 to your computer and use it in GitHub Desktop.
boost::split example
#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