版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/qq_31339221/article/details/78230673
void Replace()
{
offindex = s1.find("wbm",0);
while( offindex != string::npos )
{
cout<<"offindex:"<<offindex<<endl;
s1.replace(offindex,3,"WBM");
offindex +=1;
offindex = s1.find("wbm",offindex);
}
cout<<s1<<endl;
}