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


用另一个子串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


斯蒂芬大帝
浏览 494回答 3
3回答
打开App,查看更多内容
随时随地看视频慕课网APP