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

how to check if the first letter of a string is capitalized or uppercase in js

/**** Check if First Letter Is Upper Case in JavaScript***/
function startsWithCapital(word){
    return word.charAt(0) === word.charAt(0).toUpperCase()
}

console.log(startsWithCapital("Hello")) // true
console.log(startsWithCapital("hello")) // false
Comment

check if letter is uppercase javascript

isUpperCase('A') // true
isUpperCase('a') // false
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 :: jquery validation on button click 
Javascript :: remove negative sign from number javascript 
Javascript :: import fa icons react 
Javascript :: Handlebars: Access has been denied to resolve the property 
Javascript :: array to dictionary javascript 
Javascript :: ref schemas mongoose error 
Javascript :: dispatch keydown event javascript 
Javascript :: twitter icon in next js 
Javascript :: check if element has childs jquery 
Javascript :: justifycontent react native flatlist 
Javascript :: javascript code to loop through array 
Javascript :: disable input angular 
Javascript :: js foreach determine if last 
Javascript :: react native activity indicator 
Javascript :: check empty object 
Javascript :: how to center a canvas in javascript 
Javascript :: jquery each data 
Javascript :: page redirect after a few seconds 
Javascript :: location on select dropdown redirect jquery 
Javascript :: javascript reverse array map 
Javascript :: useRoutes exact path match in react 
Javascript :: redirect window 
Javascript :: npm create react app 
Javascript :: remove react native cli mac 
Javascript :: how to make javascript make things disappear 
Javascript :: google charts hide legend 
Javascript :: cypress enter 
Javascript :: refresh page after success ajax 
Javascript :: web3 check if contract 
Javascript :: js paste event 
ADD CONTENT
Topic
Content
Source link
Name
3+6 =