#include<iostream> #include<string> int main() { string str=; //十個(gè)字符串 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; }
網(wǎng)站名稱(chēng):c++sting類(lèi)在字符串中找相同的字符并且把他刪除
網(wǎng)頁(yè)網(wǎng)址:http://jinyejixie.com/article48/ijgphp.html
成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供網(wǎng)站排名、搜索引擎優(yōu)化、網(wǎng)站收錄、ChatGPT、網(wǎng)站設(shè)計(jì)公司、企業(yè)網(wǎng)站制作
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶(hù)投稿、用戶(hù)轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請(qǐng)盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如需處理請(qǐng)聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來(lái)源: 創(chuàng)新互聯(lián)