How to Get String Convert to Uppercase in Javascript?
Now, let's see article of how to get string convert to uppercase in javascript. it's simple example of javascript string touppercase() method. we will help you to give example of string.prototype.touppercase() - javascript. you'll learn javascript string touppercase() method.
To convert a string to uppercase in JavaScript, you can use the toUpperCase() method. Here's an example:
Example 1:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>How to Get String Convert to Uppercase in Javascript? - NiceSnippets.Com</title>
</head>
<body>
</body>
<script type="text/javascript">
let myString = "hello world";
let upperCaseString = myString.toUpperCase();.
console.log(upperCaseString); // Output: HELLO WORLD
</script>
</html>
In this example, we first initialize a variable called `myString` with the value "hello world". We then call the `toUpperCase()` method on this string and assign the result to a new variable called `upperCaseString`. Finally, we log the value of `upperCaseString` to the console, which outputs "HELLO WORLD".
- How to set Date in setUTCHours() Method in JavaScript?
- How to Date sets UTC milliseconds in Javascript?
- How to Use push(), unshift(),pop() and shift() With Array in Javascript?
- How to Check if a Variable is a Number in Javascript?
- How To Format a Number Using Fixed - Point Notation in Javascript?
- How to Insert an Element into an Array in javaScript?
- How to remove duplicate elements from JavaScript Array?
- How to calculate years, months and days between two dates in javascript?