toLowerCase()
函式会回传将字符串转换为英文小写字母后的结果。
The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request.
语法
str.toLowerCase()
回传值
回传一组将原字串英文内容转换成英文小写字母后的结果。
描述
The toLowerCase()
函式会回传一组将原字符串英文内容转换成英文小写字母后的结果。 toLowerCase()
并不会影响到原字符串 str
的内容值。
范例
使用toLowerCase()
console.log('ALPHABET'.toLowerCase()); // 'alphabet'
规范
规范 | 状态 | 注解 |
---|---|---|
ECMAScript 1st Edition (ECMA-262) | Standard | Initial definition. Implemented in JavaScript 1.0. |
ECMAScript 5.1 (ECMA-262) The definition of 'String.prototype.toLowerCase' in that specification. |
Standard | |
ECMAScript 2015 (6th Edition, ECMA-262) The definition of 'String.prototype.toLowerCase' in that specification. |
Standard | |
ECMAScript (ECMA-262) The definition of 'String.prototype.toLowerCase' in that specification. |
Living Standard |
浏览器相容性
BCD tables only load in the browser
The compatibility table in 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.