//去除多余的字符串
void VMapFactory::chompAndTrim(std::string& str)
{
while (str.length() > 0)
{
char lc = str[str.length() - 1];
if (lc == '\r' || lc == '\n' || lc == ' ' || lc == '"' || lc == '\'')
{
str = str.substr(0, str.length() - 1);
}
else
{
break;
}
}
while (str.length() > 0)
{
char lc = str[0];
if (lc == ' ' || lc == '"' || lc == '\'')
{
str = str.substr(1, str.length() - 1);
}
else
{
break;
}
}
}去掉字符串内多余字符函数
最新推荐文章于 2024-04-09 14:35:16 发布
由于博客内容为空,暂无法提供包含关键信息的摘要。
3万+

被折叠的 条评论
为什么被折叠?



