Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

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();
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #js #test #letter #lowercase
ADD COMMENT
Topic
Name
2+6 =