63,594
社区成员




#include <iostream>
#include <string>
using namespace std;
string strDel = "\r\n";//需要删除的字符
void DelRtn(string& str)
{
int nPos = 0;
while((nPos = str.find_first_of(strDel, 0))!= string::npos)
{
str.erase(nPos, 1);
}
}
int main()
{
string str("hello\r\n,world!");
cout << str << endl;
DelRtn(str);
cout << str << endl;
return 0;
}
#include <iostream>
#include <string>
using namespace std;
void DelRtn(string& str)
{
string strDel = "\r\n";
int nPos = 0;
while((nPos = str.find_first_of(strDel, 0))!= string::npos)
{
str.erase(nPos, 1);
}
}
int main()
{
string str("hello\r\n,world!");
cout << str << endl;
DelRtn(str);
cout << str << endl;
return 0;
}
#include <iostream>
#include <string>
using namespace std;
int main()
{
string str("hello\r\n,world!");
cout << str << endl;
return 0;
}