【发布时间】:2010-11-17 22:13:31
【问题描述】:
我有一个std::string A,我需要在其中找到字符串B,其内容类似于bla-bla-bla,并将其替换为其他字符串C,例如abcdefg,如果没有找到B,只需输入@987654327 @ 在A 的开头。
这样的事情怎么办?
【问题讨论】:
-
当你有一些 url 并且你想让它使用类似 'rtmp://' 而不是 'http://' 并且当然你更新知道如果 'http: //'.)
-
你看过 string::replace 和 string::find 吗?