check if letter is uppercase javascript
const isUpperCase = (string) => /^[A-Z]*$/.test(string)
check if letter is uppercase javascript
const isUpperCase = (string) => /^[A-Z]*$/.test(string)
js test letter lowercase
if (character == character.toLowerCase())
{
// The character is lowercase
}
else
{
// The character is uppercase
}
//The problem with this answer is,
//that some characters like numbers or punctuation
//also return true when checked for lowercase/uppercase.
// this is the solution for it:
function isLowerCase(str)
{
return str == str.toLowerCase() && str != str.toUpperCase();
}
check if letter is uppercase javascript
var strings = 'this iS a TeSt 523 Now!';
var i=0;
var character='';
while (i <= strings.length){
character = strings.charAt(i);
if (!isNaN(character * 1)){
alert('character is numeric');
}else{
if (character == character.toUpperCase()) {
alert ('upper case true');
}
if (character == character.toLowerCase()){
alert ('lower case true');
}
}
i++;
}
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us