How to Get String Convert to Lowercase in Javascript?

14-Apr-2023

.

Admin

How to Get String Convert to Lowercase in Javascript?

In this post, we will learn javascript string tolowercase() method. I would like to show you convert javascript string to be all lowercase. This article goes in detailed on how to convert string to lowercase in javascript?. you'll learn how to convert a string to lowercase in javascript. You just need to some step to done how to remove special characters from a string in javascript?.

To convert a string to lowercase in JavaScript, you can use the built-in `toLowerCase()` 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 Lowercase in Javascript? - NiceSnippets.Com</title>

</head>

<body>

</body>

<script type="text/javascript">

let myString = "HELLO WORLD";

let lowerCaseString = myString.toLowerCase();

console.log(lowerCaseString); // Output: hello world

</script>

</html>

In this example, we declare a variable `myString` with the value "HELLO WORLD". We then call the `toLowerCase()` method on this string and store the result in a new variable called `lowerCaseString`. Finally, we log the value of `lowerCaseString` to the console, which outputs "hello world".

#JavaScript