fork(1) download
  1. #include <string>
  2. #include <iostream>
  3. #include <boost/algorithm/string.hpp>
  4. int main()
  5. {
  6. std::string str = "This, is ,,a test string";
  7.  
  8. for( boost::algorithm::split_iterator<std::string::iterator> i
  9. // = make_split_iterator(str, token_finder(is_space()));
  10. = make_split_iterator(str, boost::first_finder(","));
  11. i != boost::algorithm::split_iterator<std::string::iterator>();
  12. ++i)
  13. {
  14. std::cout << *i << '\n';
  15. }
  16. }
  17.  
Success #stdin #stdout 0.01s 5288KB
stdin
Standard input is empty
stdout
This
 is 

a      test string