isNum

Returns true if a string is a number, with a decimal point, or without

bool
isNum
(
string s
)

Examples

assert("32".isNum == true);
assert("32.2".isNum == true);
assert("32.2.4".isNum == false);
assert("5.a".isNum == false);
assert("thisIsAVar_1234".isNum == false);

Meta