c 2b 2b std 3a 3astring find and replace

Solutions on MaxInterview for c 2b 2b std 3a 3astring find and replace by the best coders in the world

showing results for - "c 2b 2b std 3a 3astring find and replace"
Piers
01 May 2017
1#include <string>
2#include <regex>
3
4using std::string;
5
6string do_replace( string const & in, string const & from, string const & to )
7{
8  return std::regex_replace( in, std::regex(from), to );
9}
10
11string test = "Remove all spaces";
12std::cout << do_replace(test, " ", "") << std::endl;
13