Answers for "js string downcase"

89

javascript lowercase string

var str = "My Big Boy!"
var res = str.toLowerCase(); //res is "my big boy!"
Posted by: Guest on July-16-2019
1

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();
}
Posted by: Guest on August-19-2021

Code answers related to "Javascript"

Browse Popular Code Answers by Language