Answers for "first letter of a string capital"

6

capitalize first letter javascript

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

console.log(capitalizeFirstLetter('foo bar bag')); // Foo
Posted by: Guest on June-22-2020
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

Code answers related to "first letter of a string capital"

Code answers related to "Javascript"

Browse Popular Code Answers by Language