main.cpp 324 B

1234567891011121314
  1. #include <boost/algorithm/string.hpp>
  2. #include <iostream>
  3. #include <string>
  4. #include <vector>
  5. int main() {
  6. std::string s = "Hello,World";
  7. std::vector<std::string> strs;
  8. boost::split(strs, s, boost::is_any_of(","));
  9. for (const auto& str : strs) {
  10. std::cout << str << std::endl;
  11. }
  12. return 0;
  13. }