C++ (Qt)if(str[0] != ...) if(str[1] != ...)if(str[2] != ...)if(str[3] != ...)if(str[4] != ...)
C++ (Qt)float x;bool ok;x = str.toFloat(&ok);
C++ (Qt)inline bool IsDigitAndPointsOnly( const QString & s, bool emptyOk = true ){ if (!s.size()) return emtyOk; for (int i = 0; i < s.size(); ++i) if (!s[i].isDigit() && s[i] != '.') return false; return true;}