Skip to content

Instantly share code, notes, and snippets.

@sh0seo
Created February 12, 2016 16:51
Show Gist options
  • Save sh0seo/0b0f043622e198bf62a3 to your computer and use it in GitHub Desktop.
Save sh0seo/0b0f043622e198bf62a3 to your computer and use it in GitHub Desktop.
#include <boost/regex.hpp>
#include <string>
#include <iostream>
int main()
{
std::string s = " Boost Libraries ";
boost::regex expr{"\\s"};
std::string fmt{"_"};
std::cout << boost::regex_replace(s, expr, fmt) << '\n';
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment