fork download
  1. #include <iostream> /* C++ iostream C++98/11 */
  2. #include <string> /* C++ strings C++98/11 */
  3. #include <boost/regex.hpp>
  4. #include <boost/algorithm/string.hpp>
  5. /* RegEx Boost */
  6. using namespace std;
  7. int main() {
  8. std::vector<std::string> bunching_times;
  9. string specific_bunch_times_ = "12:00:00, , , 13:00:00,15:00:04";
  10.  
  11. boost::split(bunching_times,
  12. specific_bunch_times_,
  13. boost::is_any_of(", ")
  14. );
  15.  
  16. for (auto itr: bunching_times)
  17. {
  18. cout << itr << " ";
  19. }
  20. }
  21.  
Success #stdin #stdout 0.01s 5516KB
stdin
Standard input is empty
stdout
12:00:00        13:00:00 15:00:04