Answers for "write a javascript program to test the first character of a given string is uppercase or not."

0

first letter string uppercase javascript

function capitalizeFirstLetter(string) {
  return string.charAt(0).toUpperCase() + string.slice(1);
}

console.log(capitalizeFirstLetter('foo')); // Foo
Posted by: Guest on August-31-2020
1

javaSript string first words to upper case

function titleCase(str) {
  return str.toLowerCase().replace(/(^|\s)\S/g, L => L.toUpperCase());
}
Posted by: Guest on August-21-2021
0

capitalize first letter of string javascript

let val = '  this is test ';
val = val.trim();
val = val.charAt(0).toUpperCase() + val.slice(1);
console.log("Value => ", val);
Posted by: Guest on September-16-2021
1

Capitalize the first letter of string using JavaScript

function capitalizeFirstLetter(string) {
return string.charAt(0).toUpperCase() + string.slice(1);
}
Posted by: Guest on January-04-2022
0

first letter string uppercase javascript

String.prototype.capitalize = function() {
    return this.charAt(0).toUpperCase() + this.slice(1);
}
Posted by: Guest on July-26-2021

Code answers related to "write a javascript program to test the first character of a given string is uppercase or not."

Code answers related to "Javascript"

Browse Popular Code Answers by Language