mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-09-02 18:31:22 +02:00
helpers: add isDigitWord() function
returns true if all chars of string parameter are digits
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
//
|
||||
|
Reference in New Issue
Block a user