helpers: add isDigitWord() function

returns true if all chars of string parameter are digits
This commit is contained in:
2019-03-28 11:28:47 +01:00
parent 2662dcf7b8
commit 531227a482
2 changed files with 11 additions and 0 deletions

View File

@@ -1742,4 +1742,13 @@ std::string encodeUrl(std::string txt)
return txt;
}
bool isDigitWord(std::string str)
{
for (size_t i=0; i < str.size(); i++)
if (!isdigit(str[i]))
return false;
return true;
}
//