RELATEED CONSULTING
相关咨询
选择下列产品马上在线沟通
服务时间:8:30-17:00
你可能遇到了下面的问题
关闭右侧工具栏

新闻中心

这里有您想知道的互联网营销解决方案
c++sting类在字符串中找相同的字符并且把他删除
#include
#include

int main()
{
    string str=;  //十个字符串
    string::iterator it;   //stirng 迭代
    int index=str.find("\\");
    int x=0;
    while(inedx!=-1)
    {
        if((index-1)==0)  //前面的减去后面的是1那么就是相同
        {
            it=str.begin();
            cout<<"找到相同的了"
            str.erase(it+index);
        }
        x=index;
        index=str.find("\\",index+1);
    }
    
   return 0;
}

名称栏目:c++sting类在字符串中找相同的字符并且把他删除
网址分享:http://scyingshan.cn/article/ijgphp.html