在 PHP 中,有一个 str_replace
基本上执行查找和替换的功能。在 C++ 中是否有此函数的等效项?
最佳答案
不完全是,但看看 Boost String Algorithms Library - 在本例中为 replace functions :
std::string str("aabbaadd");
boost::algorithm::replace_all(str, "aa", "xx");
str
现在包含 "xxbbxxdd"
。
关于c++ - C++ 中是否有等效的 str_replace?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3081505/