//功能: 移动字符串中的"\r" "\n"
string StrClean(const string &strSource)
{
string strDes = strSource;
string::size_type index = 0;
do
{
index = strDes.find("\r");
if (index != string::npos)
{
strDes = strDes.erase(index, strlen("\r"));
}
else
{
index = strDes.find("\n");
if (index != string::npos)
{
strDes = strDes.erase(index, strlen("\r"));
}
}
} while (string::npos != index);
return strDes;
}
string StrClean(const string &strSource)
{
string strDes = strSource;
string::size_type index = 0;
do
{
index = strDes.find("\r");
if (index != string::npos)
{
strDes = strDes.erase(index, strlen("\r"));
}
else
{
index = strDes.find("\n");
if (index != string::npos)
{
strDes = strDes.erase(index, strlen("\r"));
}
}
} while (string::npos != index);
return strDes;
}