Search
 
SCRIPT & CODE EXAMPLE
 

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();
}
Comment

check if string contains lowercase javascript

// A minified version of the other one:
const hasLowerCase= s => s.toUpperCase() != s;

console.log("HeLLO: ", hasLowerCase("HeLLO"));
console.log("HELLO: ", hasLowerCase("HELLO"));
Comment

js if text contains lowercase

function hasLowerCase(str) {
    return str.toUpperCase() != str;
}

console.log("HeLLO: ", hasLowerCase("HeLLO"));
console.log("HELLO: ", hasLowerCase("HELLO"));
Comment

PREVIOUS NEXT
Code Example
Javascript :: complex json example 
Javascript :: redux devtools extension 
Javascript :: bootstrap 4 navbar-collapse not working angular 
Javascript :: install ckeditor 5 for react js 
Javascript :: jshint esversion: 6 
Javascript :: js select div 
Javascript :: javascript localstorage 
Javascript :: sum elements in list with same name js 
Javascript :: javascript number between values 
Javascript :: boolean object js 
Javascript :: react-data-table-component api action button 
Javascript :: how to scroll to an element javascript react 
Javascript :: img src in react js 
Javascript :: google sheets api javascript 
Javascript :: json array 
Javascript :: node server 
Javascript :: react private route 
Javascript :: compare two dates in javascript yyyy-mm-dd 
Javascript :: node red http post request data 
Javascript :: jquery when iframe is loaded 
Javascript :: push an property and value to an object in javascript 
Javascript :: nodejs sha512 decrypt 
Javascript :: filter out undefined from object javascript 
Javascript :: Odd number function in javascript 
Javascript :: javascript close window on button click 
Javascript :: get width of div jquery 
Javascript :: string compare on date in js 
Javascript :: react password hashing 
Javascript :: json example 
Javascript :: javascript largest number in array 
ADD CONTENT
Topic
Content
Source link
Name
3+2 =