String.prototype.toLowerCase()
Baseline Widely available
This feature is well established and works across many devices and browser versions. It’s been available across browsers since July 2015.
String
的 toLowerCase()
方法将该字符串转换为小写形式。
尝试一下
const sentence = "The quick brown fox jumps over the lazy dog.";
console.log(sentence.toLowerCase());
// Expected output: "the quick brown fox jumps over the lazy dog."
语法
js
toLowerCase()
返回值
一个新的字符串,表示转换为小写的调用字符串。
描述
toLowerCase()
方法返回将字符串转换为小写形式后的值。toLowerCase()
不会影响字符串 str
本身的值。
示例
使用 toLowerCase()
js
console.log("ALPHABET".toLowerCase()); // 'alphabet'
规范
Specification |
---|
ECMAScript® 2025 Language Specification # sec-string.prototype.tolowercase |
浏览器兼容性
Report problems with this compatibility data on GitHubdesktop | mobile | server | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
toLowerCase |
Legend
Tip: you can click/tap on a cell for more information.
- Full support
- Full support
The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.