Skip to content

Instantly share code, notes, and snippets.

@wjx0912
Last active May 18, 2018 03:33
Show Gist options
  • Save wjx0912/6201c652b2623e6dac0582e39ea7c667 to your computer and use it in GitHub Desktop.
Save wjx0912/6201c652b2623e6dac0582e39ea7c667 to your computer and use it in GitHub Desktop.
boost split demo
std::string src = " aa |b \t ccc[gg] ";
std::vector<std::string> list;
boost::split(list, std::string(src), boost::is_any_of(" \t,;\r\n|[]"), boost::token_compress_on);
if (list.size() <= 0)
return;
// output vector: aa, b, ccc, gg
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment