hasNonZeroDigit static method
check if the string has a non-zero digit
Implementation
static bool hasNonZeroDigit(String digitSequence) {
bool foundNonZero = false;
for (int i = 0; i <= digitSequence.length - 1; i++) {
foundNonZero = digitSequence[i].codeUnitAt(0) != 48;
if (foundNonZero) {
break;
}
}
return foundNonZero;
}