programming-examples/js/Vre1/Check whether the first character of a string is uppercase or not.js
2019-11-15 12:59:38 +01:00

14 lines
370 B
JavaScript

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');