- int Common::isDigitStr(QString src)
- {
- QByteArray ba = src.toLatin1();
- const char *s = ba.data();
-
- while(*s && *s>=‘0‘ && *s<=‘9‘) s++;
-
- if (*s)
- {
- return -1;
- }
- else
- {
- return 0;
- }
- }
Qt判断QString中的字符串是否为纯数字
原文:http://www.cnblogs.com/paullzytl/p/4059873.html