Now we have a problem which is that we want to capitalize a string.
Now let's imagine that we have an string like this:
And want to capitalize this string to became like this:
How to solve this problem?
The solution to this problem is easy, especially since there is a built-in function that does this called
Capitalize a string using
As we said before, we can use
toUpperCase method to capitalize our string.
Let's see an example:
// String const string = "hello world!"; // Capitalize your string const capitalize = string.toUpperCase(); // Result: console.log(capitalize);
Thank you for reading
Thank you for reading my blog. 🚀