isStringNumeric method
Returns true
if a string is made up of only numbers.
Implementation
bool isStringNumeric() {
final RegExp regExp = RegExp(r"[^\d.]+");
final String numStr = replaceAll(regExp, "");
return numStr.length == length;
}
Returns true
if a string is made up of only numbers.
bool isStringNumeric() {
final RegExp regExp = RegExp(r"[^\d.]+");
final String numStr = replaceAll(regExp, "");
return numStr.length == length;
}