📜  C++ std::string 查找和替换 - C++ 代码示例

📅  最后修改于: 2022-03-11 14:44:48.236000             🧑  作者: Mango

代码示例1
#include 
#include 

using std::string;

string do_replace( string const & in, string const & from, string const & to )
{
  return std::regex_replace( in, std::regex(from), to );
}

string test = "Remove all spaces";
std::cout << do_replace(test, " ", "") << std::endl;