Checks if a string contains only alphanumeric characters.
RegExp.prototype.test()
to check if the input string matches against the alphanumeric regexp pattern.const isAlphaNumeric = str => /^[a-z0-9]+$/gi.test(str);
isAlphaNumeric('hello123'); // true
isAlphaNumeric('123'); // true
isAlphaNumeric('hello 123'); // false (space character is not alphanumeric)
isAlphaNumeric('#$hello'); // false
JavaScript, String
Checks if a string contains only alpha characters.
JavaScript, String
Checks if the given string contains any whitespace characters.
JavaScript, String
Checks if a string is an anagram of another string (case-insensitive, ignores spaces, punctuation and special characters).