regex to check if string contains alphabets javascript code example
Example: checking if a character is an alphabet in js
function isLetter(str) {
return str.length === 1 && str.match(/[a-z]/i);
}
function isLetter(str) {
return str.length === 1 && str.match(/[a-z]/i);
}