STRING::ISDIGIT
1g 2024-04-10 laplante@plcb.ca GOWEB/STRING — Check for Digits Onlytitle: “STRING::ISDIGIT” version: “1.0.0” date: 2024-04-10 author: “laplante@plcb.ca” section: “1g”
string::isdigit Check for Digits Only
string::isdigit(string[, error: variable, string...])
isdigit(string[, error: variable, string...])
The isdigit
function checks whether the given string contains only digit characters (0–9
).
If any character is not a digit, the function returns false
.
res={{
isdigit("abc123ABC"); "\n";
isdigit("123"); "\n";
isdigit("0123456789"); "\n";
isdigit("0123456789"); "\n";
isdigit("01234e56789"); "\n";
isdigit("01234.56789"); "\n";
}}.
Returns:
res=false
true
true
true
false
false
laplante@plcb.ca