isNum method
Checks if the string represents a numeric value.
Example:
print('2021'.isNum()); // true
print('3.14'.isNum()); // true
print('abc'.isNum()); // false
Implementation
bool isNum() => num.tryParse(this) != null;
Checks if the string represents a numeric value.
Example:
print('2021'.isNum()); // true
print('3.14'.isNum()); // true
print('abc'.isNum()); // false
bool isNum() => num.tryParse(this) != null;