containsOnlyIntegers
Checks whether a string consists only of integer digits.
Returns: boolean
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
str | string | required | - | The string to check. |
Usage
Example: Check String for Integers
const str1 = "12345";
const str2 = "123a45";
console.log(nfsfu234FormValidation.containsOnlyIntegers(str1)); // true
console.log(nfsfu234FormValidation.containsOnlyIntegers(str2)); // falseLast updated on