Last active
May 18, 2018 03:33
-
-
Save wjx0912/6201c652b2623e6dac0582e39ea7c667 to your computer and use it in GitHub Desktop.
boost split demo
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::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