Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

js string check case

//Some characters like numbers or punctuation also return true 
//when checked for lowercase/uppercase.
//The solve is the second part
//I found this to work very well for it:
function isLowerCase(str)
{
    return str == str.toLowerCase() && str != str.toUpperCase();
}
console.log(isLowerCase("a")); //expected true
console.log(isLowerCase("A")); //expected false
console.log(isLowerCase("Ü")); //expected false
console.log(isLowerCase("4")); //expected false
console.log(isLowerCase("_")); //expected false
Comment

PREVIOUS NEXT
Code Example
Javascript :: javascript remove text from string 
Javascript :: javascript log dom element 
Javascript :: iterate object keys javascript 
Javascript :: js cypress div text 
Javascript :: javascript order array by date 
Javascript :: get the parent node from child node 
Javascript :: compare dates in js 
Javascript :: js check if date is future 
Javascript :: javascript distance math 
Javascript :: package json add git repo 
Javascript :: javascript reverse array 
Javascript :: Triplets summing up to a target value 
Javascript :: javascript console output 
Javascript :: node js run bat file 
Javascript :: How to make the width of a react native element adjust according to the contents 
Javascript :: google maps init map 
Javascript :: getters in nuxt vuex acccessing 
Javascript :: chart js two y axis 
Javascript :: angular maxlength directive input type number 
Javascript :: javascript infinity loop 
Javascript :: call javascript function after div load 
Javascript :: get span text jquery 
Javascript :: clean react app 
Javascript :: how to go to next page on button click js 
Javascript :: string to in js 
Javascript :: js background 
Javascript :: javascript string lentrh 
Javascript :: js 2d array to object 
Javascript :: ReferenceError 
Javascript :: find class using jquery 
ADD CONTENT
Topic
Content
Source link
Name
2+6 =