JavaScript

How to convert string to uppercase and lowercase using javascript?

How to convert string to uppercase and lowercase using javascript?, someone asked me to explain?

In this article we will discuss how to convert string to uppercase and lowercase using JavaScript. In JavaScript we can convert to Uppercase by using toUpperCase() method and for lowercase by toLowerCase() method.

Converting string to uppercase:

<script type="text/javascript">

    var mystring = "infinetsoft";

    alert(mystring.toUpperCase());

  </script>

output:

convert to uppercase

Converting string to lowercase:

<script type="text/javascript">

    var mystring = "CHIPTROLLS";

    alert(mystring.toLowerCase());
  </script>

output:

convert to lowercase

Post your comments / questions