isDigit static method

bool isDigit(
  1. String char
)

check if character is a number

Implementation

static bool isDigit(String char) {
  int asciiCode = char.codeUnitAt(0);
  return (asciiCode >= 48 && asciiCode <= 57);
}