std 提供的string的replace方法,不太方便
string replaceAll(string &str, string oldStr, string newStr){
string::size_type pos = str.find(oldStr);
while(pos != string::npos){
str.replace(pos, oldStr.size(), newStr);
pos = str.find(oldStr);
}
return str;
}
标签:std,string,oldStr,pos,replaceAll,str
From: https://www.cnblogs.com/feipeng8848/p/17046957.html