feature (utils): implemented function to check if a char is a special character
This commit is contained in:
parent
abf22ba917
commit
c60e8f9564
|
@ -52,6 +52,7 @@ void string_bool_to_alpha (string_t string, bool value);
|
|||
|
||||
bool string_is_char_text (char chr);
|
||||
bool string_is_char_number (char chr);
|
||||
bool string_is_char_special (char chr);
|
||||
bool string_is_char_alpha (char chr);
|
||||
bool string_is_char_uppercase (char chr);
|
||||
bool string_is_char_lowercase (char chr);
|
||||
|
|
|
@ -433,6 +433,16 @@ bool string_is_char_number(char chr) {
|
|||
return false;
|
||||
}
|
||||
|
||||
bool string_is_char_special(char chr) {
|
||||
if ((chr >= '!' && chr <= '/') ||
|
||||
(chr >= ':' && chr <= '@') ||
|
||||
(chr >= '^' && chr <= '`') ||
|
||||
(chr >= '{' && chr <= '~')) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
bool string_is_char_alpha(char chr) {
|
||||
if (string_is_char_uppercase(chr) || string_is_char_lowercase(chr) || string_is_char_number(chr)) {
|
||||
return true;
|
||||
|
|
Loading…
Reference in New Issue