//去除字符串中的空格符号
void CommonUtils::SkipWhitespace(char * str)
{
char *p1 = str;
char *p2 = str;
while ('\0' != *p2)
{
while (((' ' == *p2) || ('\t' == *p2) || ('\n' == *p2)) && ('\0' != *p2))
{
++p2;
}
*p1 = *p2;
if ('\0' != *p2)
{
++p1;
++p2;
}
else
{
break;
}
}
*p1 = '\0';
}
void CommonUtils::SkipWhitespace(QString &str)
{
str.replace(QRegExp("[\\s]"), "");
}
void CommonUtils::SkipWhitespace(std::string &str)
{
if (!str.empty())
{
str.erase(0, str.find_first_not_of(" "));
str.erase(str.find_last_not_of(" ") + 1);
}
}