Service to validate if a given string contains only alphanumeric characters.
ValidateAlphanumeric
const validator = new ValidateAlphanumeric();validator.validateAlphanumeric({ str: 'abc123' }).then(isValid => console.log(isValid)); // truevalidator.validateAlphanumeric({ str: 'abc 123!' }).then(isValid => console.log(isValid)); // false Copy
const validator = new ValidateAlphanumeric();validator.validateAlphanumeric({ str: 'abc123' }).then(isValid => console.log(isValid)); // truevalidator.validateAlphanumeric({ str: 'abc 123!' }).then(isValid => console.log(isValid)); // false
Contains the string to validate.
The input string that needs to be validated.
true
false
Validates if the given string contains only alphanumeric characters.
The options containing the string to validate.
Service to validate if a given string contains only alphanumeric characters.
ValidateAlphanumeric
Example
Param: options
Contains the string to validate.
Param: options.str
The input string that needs to be validated.
Returns
true
if the input string is alphanumeric, otherwisefalse
.