isDigit method

bool isDigit()

Return true if given String is Digit

Implementation

bool isDigit() {
  if (this.validate().isEmpty) {
    return false;
  }
  if (this.validate().length > 1) {
    for (var r in this!.runes) {
      if (r ^ 0x30 > 9) {
        return false;
      }
    }
    return true;
  } else {
    return this!.runes.first ^ 0x30 <= 9;
  }
}