小编Joh*_*son的帖子

C++在一次传递中替换字符串中的多个字符串

给出以下字符串, "Hi ~+ and ^*. Is ^* still flying around ~+?"

我想替换所有出现"~+",并"^*"以"波比"和"丹尼",因此字符串变成:

"Hi Bobby and Danny. Is Danny still flying around Bobby?"

我宁愿不必两次调用Boost替换函数来替换两个不同值的出现.

c++ string boost str-replace

17
推荐指数
2
解决办法
6567
查看次数

标签 统计

boost ×1

c++ ×1

str-replace ×1

string ×1