Home > Article > Web Front-end > How to convert string to lowercase in javascript
In JavaScript, you can use the toLowerCase method to convert a string to lowercase. The syntax is "stringObject.toLowerCase()". This method can be used to convert a string to lowercase.
The operating environment of this article: windows7 system, javascript version 1.8.5, DELL G3 computer
How does javascript convert a string to lowercase?
toLowerCase() method;
Definition: The toLowerCase() method is used to convert a string to lowercase.
Syntax:
var str = "String"; str .toLowerCase();// string
toLowerCase() method is used to convert strings to lowercase.
toLowerCase() method introduction:
stringObject.toLowerCase()
Return value
A new string in which all uppercase characters of stringObject are converted to Lowercase characters.
Example
In this example, "Hello world!" will be displayed in lowercase letters:
<script type="text/javascript"> var str="Hello World!" document.write(str.toLowerCase()) </script>
Recommended study: "javascript Advanced Tutorial 》
The above is the detailed content of How to convert string to lowercase in javascript. For more information, please follow other related articles on the PHP Chinese website!