win7搜索文件内容 | 您所在的位置:网站首页 › win7搜索文件内容关键字 › win7搜索文件内容 |
std::string实现全部替换功能
我是是是是是西红柿: 不错,给你改良了下 void StringReplace(string& strBase, const string& strSrc, const string& strDes) { string::size_type nPos = 0; string::size_type nSrcLen = strSrc.size(); while (true) { nPos = strBase.find(strSrc); if (nPos >= string::npos) { break; } strBase.replace(nPos, nSrcLen, strDes); } } |
CopyRight 2018-2019 实验室设备网 版权所有 |