I'm currently working on a function to check for specific conditions in a string. However, I've hit a roadblock while attempting to determine whether the first character in the string consists of only letters.
function CheckStringConditions(inputString) {
// implementation here
let onlyLettersRegex = /^[a-zA-Z]+$/;
if (inputString.length > 4 && inputString.length < 25){
if (onlyLettersRegex.test(inputString)){
return true;
} else {
return false;
}
} else {
return false;
}
}
The string "u__adced_123" should return true but is currently returning false. I even attempted using str[0]==onlyLetters but encountered the same issue.