checkMaxDigit static method
Implementation
static bool checkMaxDigit(String string, int maxDigit) {
int counter = 0;
for (int i = 0; i < string.length; i++) {
if (string.codeUnitAt(i) >= 0 && string.codeUnitAt(i) <= 9) {
counter++;
}
}
if (counter <= maxDigit) {
return true;
}
return false;
}