Answers for "check first character of string whether uppercase or not?"

0

check first character of string whether uppercase or not?

function upper_case(str)
{
   regexp = /^[A-Z]/;
   if (regexp.test(str))
    {
      console.log("String's first character is uppercase");
    } 
    else
    {
      console.log("String's first character is not uppercase");
    }
}
upper_case('Abcd');
upper_case('abcd');
Posted by: Guest on September-05-2021

Code answers related to "check first character of string whether uppercase or not?"

Browse Popular Code Answers by Language