Check if letter in String is Uppercase or Lowercase in JS-Code Examples

Radu TM

Check if letter in String is Uppercase or Lowercase in JS

JavaScript by Radu TM June 22, 2022

const input = "i ♥ JS";

// check if the first letter is uppercase
if (input.charAt(0).toUpperCase() === input.charAt(0)) {
  console.log("The first letter is uppercase");
} else {
  console.log("The first letter is lowercase");
}

0

30.361

Related JavaScript Queries

Latest JavaScript Queries

Explore code examples by categories