Answered by : godswill-ohiole-agangan
const word = "freecodecamp"
const capitalized = word.charAt(0).toUpperCase() + word.slice(1)
// Freecodecamp
// F is capitalized
Source : https://www.freecodecamp.org/news/javascript-capitalize-first-letter-of-word/ | Last Update : Fri, 01 Jul 22
Answered by : sudipnext
const names = ["alice", "bob", "charlie", "danielle"]
// --> ["Alice", "Bob", "Charlie", "Danielle"]
//Just use some anonymous function and iterate through each of the elements in the array
//and take string as another array
let namescap = names.map((x)=>{ return x[0].toUpperCase()+x.slice(1)
})
console.log(namescap)
Source : | Last Update : Mon, 24 Oct 22
Answered by : helpless-hamster-iyyzaozffwgx
>>> "hello world".title()
'Hello World'
>>> u"hello world".title()
u'Hello World'
Source : https://stackoverflow.com/questions/1549641/how-can-i-capitalize-the-first-letter-of-each-word-in-a-string | Last Update : Tue, 28 Jun 22
Answered by : itchy-iguana-yewbikurcqns
const name = 'flavio'
const nameCapitalized = name.charAt(0).toUpperCase() + name.slice(1)
Source : https://www.tech-wiki.online/en/how-to-uppercase-first-letter-javascript.html | Last Update : Sun, 23 Jan 22
Answered by : yafet-segid
function firstCapitalLetter(name){ return name[0].slice('').toUpperCase() + name.slice(1).toLowerCase()
} console.log(firstCapitalLetter('front '))
Source : | Last Update : Thu, 11 Aug 22
Answered by : troubled-tapir-axuezag30mer
String name;
BufferedReader br = new InputStreamReader(System.in);
String s1 = name.charAt(0).toUppercase());
System.out.println(s1 + name.substring(1));
Source : https://stackoverflow.com/questions/3904579/how-to-capitalize-the-first-letter-of-a-string-in-java | Last Update : Fri, 27 May 22
Answered by : md-razzak
// name er first letter uppercase
let name = "aminul islam rasel" //Aminul Islam Rasel let word = name.split(" ") // create array each word word[0] = word[0].charAt(0).toUpperCase() + word[0].slice(1) word[1] = word[1].charAt(0).toUpperCase() + word[1].slice(1) word[2] = word[2].charAt(0).toUpperCase() + word[2].slice(1) name = word.join(" ")// get Aminul Islam Rasel console.log(name);//show console
// array map method use kore let name = "abdur razzak hassan tusher mafus ulla" let word = name.split(" ") word = word.map(function (value) { return value.charAt(0).toUpperCase() + value.slice(1) }) name = word.join(" ") console.log(name);
Source : | Last Update : Mon, 18 Apr 22
Answered by : doubtful-dogfish-afpaozrlqjc7
string.charAt(index)
Source : https://flexiple.com/javascript-capitalize-first-letter/ | Last Update : Tue, 26 Oct 21