--- title: String.prototype.toLowerCase() slug: Web/JavaScript/Reference/Global_Objects/String/toLowerCase tags: - JavaScript - Method - Prototype - String - toLowerCase() translation_of: Web/JavaScript/Reference/Global_Objects/String/toLowerCase ---
toLowerCase() 会将调用该方法的字符串值转为小写形式,并返回。
str.toLowerCase()
一个新的字符串,表示转换为小写的调用字符串。
toLowerCase 会将调用该方法的字符串值转为小写形式,并返回。toLowerCase 不会影响字符串本身的值。
toLowerCase()console.log('中文简体 zh-CN || zh-Hans'.toLowerCase());
// 中文简体 zh-cn || zh-hans
console.log( "ALPHABET".toLowerCase() );
// "alphabet"
说明
| Specification | Status | Comment |
|---|---|---|
| {{SpecName('ES1')}} | {{Spec2('ES1')}} | Initial definition. Implemented in JavaScript 1.0. |
| {{SpecName('ES5.1', '#sec-15.5.4.16', 'String.prototype.toLowerCase')}} | {{Spec2('ES5.1')}} | |
| {{SpecName('ES6', '#sec-string.prototype.tolowercase', 'String.prototype.toLowerCase')}} | {{Spec2('ES6')}} | |
| {{SpecName('ESDraft', '#sec-string.prototype.tolowercase', 'String.prototype.toLowerCase')}} | {{Spec2('ESDraft')}} | |