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 Latest Draft (ECMA-262) The definition of 'String.prototype.toLowerCase' in that specification. |
Draft |
浏览器相容性
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.
Update compatibility data on GitHub
Desktop | Mobile | Server | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
toLowerCase | Chrome Full support 1 | Edge Full support 12 | Firefox Full support 1 | IE Full support 3 | Opera Full support Yes | Safari Full support Yes | WebView Android Full support 1 | Chrome Android Full support 18 | Firefox Android Full support 4 | Opera Android Full support Yes | Safari iOS Full support Yes | Samsung Internet Android Full support 1.0 | nodejs Full support Yes |
Legend
- Full support
- Full support