STRING::ISDIGIT 1g 2024-04-10 laplante@plcb.ca GOWEB/STRING — Check for Digits Only


title: “STRING::ISDIGIT” version: “1.0.0” date: 2024-04-10 author: “laplante@plcb.ca” section: “1g”

category: “GOWEB/STRING”

Name

string::isdigit Check for Digits Only

Synopsis

string::isdigit(string[, error: variable, string...])
isdigit(string[, error: variable, string...])

Description

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.


Examples

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

Author

laplante@plcb.ca

See Also


Version