isLowerCase function

bool isLowerCase(
  1. String string
)

Returns true if the string does not contain upper case letters; otherwise false;

Example: print(isLowerCase("camelCase")); => false

print(isLowerCase("dart"));
=> true

print(isLowerCase(""));
=> false

Implementation

bool isLowerCase(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 & _UPPER != 0) {
          return false;
        }
      } else {
        if (s == s.toUpperCase()) {
          return false;
        }
      }
    }
  }

  return true;
}