Answers for "javascript string 1st character uppercase without inbuilt function"

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

js first letter to uppercase

function capitalizeFirstLetter(name) {
    return name.replace(/^./, name[0].toUpperCase())
}
Posted by: Guest on April-21-2021

Code answers related to "javascript string 1st character uppercase without inbuilt function"

Code answers related to "Javascript"

Browse Popular Code Answers by Language