[utils] string_is_lower/string_is_upper method

This commit is contained in:
Al
2015-07-01 14:49:17 -04:00
parent 58c6ff104a
commit b58877ec6c
2 changed files with 18 additions and 2 deletions

View File

@@ -76,10 +76,24 @@ void string_upper(char *s) {
for (; *s; ++s) *s = toupper(*s);
}
bool string_is_upper(char *s) {
for (; *s; ++s) {
if (*s != toupper(*s)) return false;
}
return true;
}
void string_lower(char *s) {
for (; *s; ++s) *s = tolower(*s);
}
bool string_is_lower(char *s) {
for (; *s; ++s) {
if (*s != tolower(*s)) return false;
}
return true;
}
uint string_translate(char *str, size_t len, char *word_chars, char *word_repls, size_t trans_len) {
uint num_replacements = 0;