Add is_number()

This will be used to check if a string is a valid integer. So negative
numbers are accepted, unlike is_positive_num().
This commit is contained in:
Misa
2020-08-06 21:22:10 -07:00
committed by Ethan Lee
parent b8b616e282
commit 502d597aeb
2 changed files with 14 additions and 0 deletions

View File

@@ -11,6 +11,8 @@ std::vector<std::string> split(const std::string &s, char delim, std::vector<std
std::vector<std::string> split(const std::string &s, char delim);
bool is_number(const char* str);
bool is_positive_num(const std::string& str, bool hex);
bool endsWith(const std::string& str, const std::string& suffix);