1function isUpper(str) {
2 return !/[a-z]/.test(str) && /[A-Z]/.test(str);
3}
4
5isUpper("FOO"); //true
6isUpper("bar"); //false
7isUpper("123"); //false
8isUpper("123a"); //false
9isUpper("123A"); //true
10isUpper("A123"); //true
11isUpper(""); //false
12
1var strings = 'this iS a TeSt 523 Now!';
2var i=0;
3var character='';
4while (i <= strings.length){
5 character = strings.charAt(i);
6 if (!isNaN(character * 1)){
7 alert('character is numeric');
8 }else{
9 if (character == character.toUpperCase()) {
10 alert ('upper case true');
11 }
12 if (character == character.toLowerCase()){
13 alert ('lower case true');
14 }
15 }
16 i++;
17}
18
1var str = S;
2
3 if (str == str.toUpperCase())
4 {
5 console.log(" Uppercase");
6 }
7 else
8 {
9 console.log("Lowercase");
10 }