fork download
  1. #include <iostream> /* C++ iostream C++98/11 */
  2. #include <string> /* C++ strings C++98/11 */
  3. #include <boost/regex.hpp> /* RegEx Boost */
  4. #include<boost/algorithm/string.hpp>
  5.  
  6. int main() {
  7.  
  8. /* Our strings and string forms for the regualr expressions. */
  9.  
  10. std::string rawUserQuery = "abc+edf+ggg";
  11. boost::replace_all(rawUserQuery, "+", "%20");
  12. std::cout<<rawUserQuery;
  13.  
  14. }
  15.  
Success #stdin #stdout 0.01s 5548KB
stdin
Standard input is empty
stdout
abc%20edf%20ggg