![]() We will use this method to cut out the remaining part of a word (excluding the first letter): const word = "freecodecamp"Ĭonst remainingLetters = word.substring(1) You use this method to cut out a substring from an entire string. Using this method, we can retrieve the first letter in a word: const word = "freecodecamp" You use this method to retrieve the character at a specified position in a string. To capitalize the first letter of a word with JS, you need to understand three string methods: charAt, slice, and toUpperCase. In this article, I will show you one approach to achieve this. You can use CSS as well as some JavaScript methods. When you're coding, there are many ways to capitalize the first letter of a word.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |