capitalize

Solutions on MaxInterview for capitalize by the best coders in the world

showing results for - "capitalize"
Annamaria
01 Jul 2019
1const capitalize = s => {
2  s = s.split('')
3  let finalArr = []
4  let i = 0
5  while(i < 2){
6    let str = ''
7    s.forEach((letter, index) => {
8      if(i % 2 === 0 && index % 2 === 0) str += letter.toUpperCase()
9      else if(i % 2 !== 0 && index % 2 !== 0) str += letter.toUpperCase()
10      else str += letter
11    })
12      
13    finalArr.push(str)
14    i++
15  }
16  return finalArr
17};
18console.log(capitalize("abcdef"))
Ana
10 Apr 2017
1function capitalize1(str) {
2  const arrOfWords = str.split(" ");
3  const arrOfWordsCased = [];
4
5  for (let i = 0; i < arrOfWords.length; i++) {
6    const word = arrOfWords[i];
7    arrOfWordsCased.push(word[0].toUpperCase() + word.slice(1).toLowerCase());
8  }
9
10  return arrOfWordsCased.join(" ");
11}
queries leading to this page
auto capitalisationdo we capitalize thecapitalizetitle what to capitalizecapitalize composed namemla title capitalization ruleswhich letter should be capitalized in a titleautomatic title capitalizercapitalize title wordsapa title genratorcapitalize onlinedo i capitalize thetitle capitalizecapitalize toolscaltalize definitionis you capitalize din a titlecapitalize textall capitalizecapitalize generatortitle capitolization toolauto capitalize capitalise textword capitalizerwhat is capitalizecapitalize itcursive capital letterstitle capitilzertitle capitalization convertercapitalize in fdarttitle thiscapitalize examplehow to capitalize a title 22a 22 capitalize 28 29capitalization meaningnhow to message capital onewhat to capitalize in a titlecapitalized titlefinalize capitalcapitalize otoltitle capitalizationshould i capitalizewhat capitalize meansfully capitalize stringcapitalize headlinebook title capialization helpercapitalization toolcapitalize oppositecapitalize meaniguppercasetitle capitalisationcapitalize titlefastest algorithm for capitalize stringcapitalize the word in in a titletext capitalizetitle casingfirst letter capitalizeddo you capitalize inscalable capitalcapitalize meaning capitalizesenntence title correction onlinewhat is capitalizationto capitalizedefine capitalizecapitalize tools accoucapitalize funcapitalize converterozon capitalizationcapitalize 28what do you capitalize in a titlecheck capitalizedo you capitalize fortitle casing rulescapitalize namecapitalizationfor title capitalizationcapitalization what is title case generatoris to capital in a titleopposite of capitalizecapitalize my title onlinecapitalization title rulescapitalize thiscapitalize in the in the titlecapitalize sentencehow to capitalizeproper title casecapital letters in titles thecapitalize casecapitalize first letter onlinecapitalize vs uppercasecapitalize and in titlealternate capitalizationcapitalize definitioncapital lettersopposite capitalization toolcapitalize upper casecapitalize toolwhat does capitalize meancapitalize onwhat does capitalized meanmla title capitalizationonline capitalizationcapitalize ititle capitalization rulesdo you capitalize and capitalizewhen to capitalizetext capitalizer capitalizemla title checkerheader capitalizationshould i capitalize thecapitalize wordscapitalize the sentencecapitalization titledo you capitalize thehow to capitalize titlestypes of capitalhow to properly capitalize a titlecapital lettercapitalize uppercasecapitalize text onlinecapitalize