VC字符判断

VC中判断是否数字的方法(转自他人博客) 方法一: int IsNum(CString str) { if (str.IsEmpty()) return - 1; int nDot = 0; //数值只能是0到9及小数点组成 for (int i = 0; i < str.GetLength(); i++) { char ch = str.GetAt(i); if ('.' == ch) //小数点 { nDot++; continue; } ...
最新评论