How to convert uppercase string to lowercase in javascript

青灯夜游
Release: 2021-06-18 16:54:43
Original
3705 people have browsed it

In JavaScript, you can use the toLowerCase() method to convert an uppercase string to lowercase. This method can convert all uppercase characters in the string to lowercase characters. The syntax format is "string.toLowerCase()" .

How to convert uppercase string to lowercase in javascript

The operating environment of this tutorial: windows7 system, javascript version 1.8.5, Dell G3 computer.

In javascript, you can use the toLowerCase() function to convert uppercase strings to lowercase.

Let’s learn about it through an example:

var str="Hello World!" console.log(str.toLowerCase());
Copy after login

Output:

How to convert uppercase string to lowercase in javascript

var str="HELLO WORLD!" console.log(str.toLowerCase());
Copy after login

Output:

How to convert uppercase string to lowercase in javascript

Description:

toLowerCase() method is used to convert a string to lowercase. All uppercase characters in the string can be converted to Lowercase characters.

Syntax

stringObject.toLowerCase()
Copy after login

Return value

A new lowercase string.

[Related recommendations:javascript learning tutorial]

The above is the detailed content of How to convert uppercase string to lowercase in javascript. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!