相关疑难解决方法(0)

用另一个子串C++替换substring

我怎么能用C++中的另一个子字符串替换字符串中的子字符串,我可以使用哪些函数?

eg: string test = "abc def abc def";
test.replace("abc", "hij").replace("def", "klm"); //replace occurrence of abc and def with other substring
Run Code Online (Sandbox Code Playgroud)

c++ string replace substring

79
推荐指数
8
解决办法
14万
查看次数

标签 统计

c++ ×1

replace ×1

string ×1

substring ×1