Skip to Content
NFSFU234FormValidation v3 is here — file upload validation, config-driven rules, and more.
v3 (current)containsOnlyIntegers

containsOnlyIntegers

Checks whether a string consists only of integer digits. Returns: boolean

ParameterTypeRequiredDefaultDescription
strstringrequired-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)); // false
Last updated on