Advertisement
Guest User

Untitled

a guest
Jan 23rd, 2017
138
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.29 KB | None | 0 0
  1.  std::string data {"5020303000182306,,30502,,2,0,,,0"},str = data;
  2.   std::regex re(",,");
  3.   const std::string fmt = ", ,";
  4.   do
  5.   {
  6.     str = std::regex_replace(str,re,fmt,std::regex_constants::match_prev_avail);
  7.   }
  8.   while(std::regex_search(str,re));
  9.   std::cerr << str << std::endl;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement