Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

check if letter is uppercase javascript

const isUpperCase = (string) => /^[A-Z]*$/.test(string)
Comment

javascript check if all capital letter

function isUpper(str) {
    return !/[a-z]/.test(str) && /[A-Z]/.test(str);
}

isUpper("FOO"); //true
isUpper("bar"); //false
isUpper("123"); //false
isUpper("123a"); //false
isUpper("123A"); //true
isUpper("A123"); //true
isUpper(""); //false
Comment

check to see if work is uppercase javascript

var word = 'apple' //Expected: false

//Use word[0] to grap the first letter
if (word[0] == word[0].toUpperCase()) {
  //Word is uppercase
} else {
  //Word is not uppercase
}
Comment

check if letter is uppercase javascript

var strings = 'this iS a TeSt 523 Now!';
var i=0;
var character='';
while (i <= strings.length){
    character = strings.charAt(i);
    if (!isNaN(character * 1)){
        alert('character is numeric');
    }else{
        if (character == character.toUpperCase()) {
            alert ('upper case true');
        }
        if (character == character.toLowerCase()){
            alert ('lower case true');
        }
    }
    i++;
}
Comment

check if letter is uppercase javascript

isUpperCase('A') // true
isUpperCase('a') // false
Comment

how to find if given character in a string is uppercase or lowercase in javascript

var str = S;

  if (str == str.toUpperCase())
  {
    console.log(" Uppercase");
  }
  else
  {
    console.log("Lowercase");
  }
Comment

how to check if a letter is capital in javascript

// program to convert first letter of a string to uppercase
function capitalizeFirstLetter(str) {

    // converting first letter to uppercase
    const capitalized = str.charAt(0).toUpperCase() + str.slice(1);

    return capitalized;
}

// take input
const string = prompt('Enter a string: ');

const result = capitalizeFirstLetter(string);

console.log(result);
Comment

PREVIOUS NEXT
Code Example
Javascript :: javascript innerhtml table 
Javascript :: jquery scroll to top of div 
Javascript :: difference between e.preventdefault and e.stoppropagation and return false 
Javascript :: acces vue instance from console 
Javascript :: javascript generate random string 
Javascript :: NullInjectorError: R3InjectorError(DashboardModule)[DatabaseService - DatabaseService - HttpClient 
Javascript :: javascript set target blank 
Javascript :: if document is loaded 
Javascript :: get iso date javascript 
Javascript :: To set the dropdown default value using jquery 
Javascript :: delete cr eslint 
Javascript :: get child element by class javascript 
Javascript :: post antiforgerytoken jquery 
Javascript :: pagecontrol 
Javascript :: sort js array by date 
Javascript :: text to speech js 
Javascript :: open json file r 
Javascript :: get index pixel of canvas 
Javascript :: convert stream to string javascript 
Javascript :: javascript array of all characters 
Javascript :: javascript add div before element 
Javascript :: javascript hashtable contains key 
Javascript :: jquery in checkbox checked 
Javascript :: jquery if screen size 
Javascript :: how to sum array elements in javascript 
Javascript :: load jquery in the browser code 
Javascript :: increment day date javascript 
Javascript :: console load jquery 
Javascript :: como remover uma variável de um json 
Javascript :: javascript truncate with ellipsis 
ADD CONTENT
Topic
Content
Source link
Name
3+3 =