String.prototype.toLowerCase()

toLowerCase() 函式会回传将字符串转换为英文小写字母后的结果。

语法

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

浏览器相容性

Update compatibility data on GitHub
DesktopMobileServer
ChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetNode.js
toLowerCaseChrome Full support 1Edge Full support 12Firefox Full support 1IE Full support 3Opera Full support YesSafari Full support YesWebView Android Full support 1Chrome Android Full support 18Firefox Android Full support 4Opera Android Full support YesSafari iOS Full support YesSamsung Internet Android Full support 1.0nodejs Full support Yes

Legend

Full support  
Full support

参考