What is toLowerCase() Method in JavaScript ?
Last Updated :
12 Feb, 2024
Javascript str.toLowerCase() method converts the entire string to lowercase. This method does not affect any of the special characters, digits, and the alphabet that is already in lowercase.
Syntax:
str.toLowerCase();
Example: Here, the toLowerCase()
method is called on the str
string, converting all uppercase letters to lowercase. The resulting string, "hello world"
, is assigned to the variable lowerStr
.
Javascript
const str = "HELLO WORLD" ;
const lowerStr = str.toLowerCase();
console.log(lowerStr);
|
Share your thoughts in the comments
Please Login to comment...