JavaScript
is a popular programming language, which is usually used for web development.
With the help of JavaScript, various types of tasks can be easily done. In
today's blog, I will discuss in detail with code how to convert any lowercase
letter to uppercase.
Problem
– Converting lowercase letters to uppercase letters?
Code
// Original string
let str = "I am now trying to learn javascript";
// Converting all characters to uppercase
let upperStr = str.toUpperCase();
// Logging the converted string to the console
console.log(upperStr);
// Output
I AM NOW TRYING TO LEARN JAVASCRIPT
Explanation
of code
- First, I created a string, which contains some lowercase letters.
- The toUpperCase() method converts all the lowercase letters in the string to uppercase letters.
- Finally, the converted string is shown in the console through console.log().
Bookmark
the website! If you like the post and don't forget to share the post so that
your friends don't miss it. Be sure to like and comment so that we can
constantly come up with new problems as well as solutions. And if you also have
any coding-related problems, let us know in the comment box and we will try to
solve them, InshaAllah.