toDigit method

  1. @override
int toDigit(
  1. String ch
)
override

Implementation

@override
int toDigit(String ch) {
  if (ch.codeUnitAt(0) >= '0'.codeUnitAt(0) &&
      ch.codeUnitAt(0) <= '9'.codeUnitAt(0)) {
    return ch.codeUnitAt(0) - 48;
  }
  throw AssertionError('Not valid digit: ' + ch);
}