mirror of
https://github.com/ddnet/ddnet.git
synced 2024-09-20 09:34:19 +00:00
Add str_isallnum_hex
To check if string contains only `[0-9a-zA-Z]`.
This commit is contained in:
parent
bb5e203f3a
commit
0aa55e224c
|
@ -3430,6 +3430,17 @@ int str_isallnum(const char *str)
|
|||
return 1;
|
||||
}
|
||||
|
||||
int str_isallnum_hex(const char *str)
|
||||
{
|
||||
while(*str)
|
||||
{
|
||||
if(!(*str >= '0' && *str <= '9') && !(*str >= 'a' && *str <= 'f') && !(*str >= 'A' && *str <= 'F'))
|
||||
return 0;
|
||||
str++;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
int str_toint(const char *str)
|
||||
{
|
||||
return str_toint_base(str, 10);
|
||||
|
|
|
@ -2186,7 +2186,11 @@ float str_tofloat(const char *str);
|
|||
int str_isspace(char c);
|
||||
|
||||
char str_uppercase(char c);
|
||||
|
||||
int str_isallnum(const char *str);
|
||||
|
||||
int str_isallnum_hex(const char *str);
|
||||
|
||||
unsigned str_quickhash(const char *str);
|
||||
|
||||
enum
|
||||
|
|
Loading…
Reference in a new issue