JavaScript toUpperCase()

📔 : Java Script 🔗

toUpperCase() method String को uppercase letters में convert करता है। हालाँकि यह original String में कोई changes नहीं करता है।

Important
String को lowercase में convert करने के लिए toLowerCase() method use करते हैं।


JavaScript toUpperCase Syntax

string.toUpperCase()

Parameters
  1. string | required : यह String variable है जिसे आप uppercase letters में convert करना चाहते हैं।

  2. Return Value : String को uppercase letters में convert करके return करता है।

JavaScript toUpperCase Example

File : js_toUpperCase.html

CopyFullscreenClose FullscreenRun
<!DOCTYPE html>
<html>
  <body>
    <script>
      let str = "Hello world!.";
      document.write(str.toUpperCase());
      document.write("<br> Original String: " + str);
    </script>
  </body>
</html>
Output
HELLO WORLD!.
Original String: Hello world!.

Related Topics :

Rahul Kumar

Rahul Kumar

Hi ! My name is Rahul Kumar Rajput. I'm a back end web developer and founder of learnhindituts.com. I live in Uttar Pradesh (UP), India and I love to talk about programming as well as writing technical tutorials and tips that can help to others.

Get connected with me. :) LinkedIn Twitter Instagram Facebook