stringEvery function

bool stringEvery(
  1. bool allFunction(
    1. String element
    ),
  2. String s
)

Check if every character meets criteria

Implementation

bool stringEvery(bool Function(String element) allFunction, String s) {
  if (s.isEmpty) {
    return false;
  }
  for (int i in s.codeUnits) {
    if (!allFunction(String.fromCharCode(i))) {
      return false;
    }
  }
  return true;
}