Last active
June 28, 2022 05:22
-
-
Save yangjiheng/d3313b7caa62b21ff4c04eb82264fcea to your computer and use it in GitHub Desktop.
Check if a QString is a number
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
bool isNumber(const QString str) | |
{ | |
QRegExp re("\\d*"); | |
if (re.exactMatch(str)) { | |
return true; | |
} | |
return false; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment