diff --git a/src/system/helpers.cpp b/src/system/helpers.cpp index 5712c70e2..3037a7a81 100644 --- a/src/system/helpers.cpp +++ b/src/system/helpers.cpp @@ -1929,4 +1929,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; +} + // diff --git a/src/system/helpers.h b/src/system/helpers.h index eb788e23d..6feed86a8 100644 --- a/src/system/helpers.h +++ b/src/system/helpers.h @@ -186,5 +186,7 @@ std::string decodeUrl(std::string url); bool getUrl(std::string &url, std::string &answer, const std::string userAgent = " ", unsigned int timeout = 60); bool downloadUrl(std::string url, std::string file, const std::string userAgent = " ", unsigned int timeout = 60); +bool isDigitWord(std::string str); + // #endif