isDigitStringInRange function

bool isDigitStringInRange(
  1. String s,
  2. int offset,
  3. int length
)

Implementation

bool isDigitStringInRange(String s, int offset, int length) {
  if (length <= 0) return false;

  var end = Math.min(s.length, offset + length);

  for (var i = offset; i < end; i++) {
    var c = s.codeUnitAt(i);
    if (!isDigit(c)) return false;
  }

  return true;
}