In this Post We Will Explain About is How To Capitalize The First Letter Of A String In JavaScript With Example and Demo.Welcome on, The best For Learn web development Tutorials,Demo with Example! Hi Dear Friends here u can know to javascript capitalize first letter of each word ExampleIn this post we will show you Best way to implement How to Capitalize the First Letter of a String in JavaScript, hear for How do I make the first letter of a string uppercase in JavaScript with Download.we will give you demo,Source Code and examples for implement Step By Step Good Luck!
The function below does not change any other part of the string than trying to convert all the first letters of all words (i.e. By the regex definition w+) to uppercase. That means it does not necessarily convert words to Titlecase, but does exactly what the title of the question says: 'Capitalize First Letter Of Each Word In A String. Next we use the uppercase function in JavaScript to set this string to be in capitals. Var uppercaseFirstLetter = string.charAt(0).toUpperCase; Then we can add the rest of the string on to this capital letter by using the function slice which will allow us to.