isUpperCase function
Returns true if the string does not contain lower case letters; otherwise false;
Example: print(isUpperCase("CamelCase")); => false
print(isUpperCase("DART"));
=> true
print(isUpperCase(""));
=> false
Implementation
bool isUpperCase(String string) {
if (string.isEmpty) {
return true;
}
final characters = Characters(string);
for (final s in characters) {
final runes = s.runes;
if (runes.length == 1) {
var c = runes.first;
var flag = 0;
if (c <= _ASCII_END) {
flag = _ascii[c];
}
if (c <= _ASCII_END) {
if (flag & _LOWER != 0) {
return false;
}
} else {
if (s == s.toLowerCase()) {
return false;
}
}
}
}
return true;
}