Answers for "first letter capitalized"

32

javascript capitalize first letter

const lower = 'this is an entirely lowercase string';
const upper = lower.charAt(0).toUpperCase() + lower.substring(1);
Posted by: Guest on March-04-2020
0

first letter capital in javascript

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

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

first letter tuUppercase

const string = "tHIS STRING'S CAPITALISATION WILL BE FIXED."
const string = string[0].toUpperCase() + string.slice(1)
Posted by: Guest on October-15-2020
1

make first letter uppercase

const publication = "freeCodeCamp";
publication[0].toUpperCase() + publication.substring(1);
Posted by: Guest on December-27-2020
0

string capitalize first letter

string_name.capitalize() 

string_name: It is the name of string of
             whose first character we want
             to capitalize.
Posted by: Guest on August-13-2021
-1

capitalize

function capitalize1(str) {
  const arrOfWords = str.split(" ");
  const arrOfWordsCased = [];

  for (let i = 0; i < arrOfWords.length; i++) {
    const word = arrOfWords[i];
    arrOfWordsCased.push(word[0].toUpperCase() + word.slice(1).toLowerCase());
  }

  return arrOfWordsCased.join(" ");
}
Posted by: Guest on August-17-2020

Code answers related to "first letter capitalized"

Code answers related to "Javascript"

Browse Popular Code Answers by Language