JavaScript String toUpperCase() Method - JavaScript Tutorial

JavaScript String toUpperCase() Method

BLUF: This tutorial on JavaScript String toUpperCase() Method provides an in-depth look at JavaScript's core features. It includes practical examples and code snippets to help you master modern JS development.
Key Discovery: JavaScript String toUpperCase() Method

Understanding JavaScript String toUpperCase() Method is crucial for building dynamic, interactive web applications. Explore the examples below to see it in action.

The method toUpperCase in JavaScript is utilized to transform a string into uppercase. It does not modify the original string in any way.

Syntax

The syntax for invoking the toUpperCase method is as follows:

Example

string.toUpperCase()

Return

String in uppercase letter.

JavaScript String toUpperCase Method Example

Let's explore a few basic illustrations showcasing the implementation of the toUpperCase function.

Example 1

In this section, we will demonstrate how to display a string in uppercase characters.

Example

<script>

var str = "Example";

document.writeln(str.toUpperCase());

</script>

Output:

Output

Example

Example 2

Here is another illustration demonstrating how to display a string in capital letters.

Example

<script>

var str = "C# Tutorial TUTORIALS";

document.writeln(str.toUpperCase());

</script>

Output:

Output

C# Tutorial TUTORIALS

Input Required

This code uses input(). Please provide values below:

Logic Practice
Install Logic Practice
Add to home screen for a faster app-like experience