当前位置: 首页 > 文档资料 > Lazy.js 英文文档 >

toLowerCase

优质
小牛编辑
125浏览
2023-12-01

Converts all of the characters in this string to lowercase.

Signature

StringLikeSequence.toLowerCase = function() { /*...*/ }
StringLikeSequence.toLowerCase = function toLowerCase() {
  return this.mapString(function(char) { return char.toLowerCase(); });
}
NameType(s)Description
returnsStringLikeSequence

A new sequence with the same characters as this sequence, all lowercase.

Examples

function nextLetter(a) {
  return String.fromCharCode(a.charCodeAt(0) + 1);
}

Lazy('FOO').toLowerCase()                       // sequence: 'foo'
Lazy('FOO').substring(1).toLowerCase()          // sequence: 'oo'
Lazy('ABC').mapString(nextLetter).toLowerCase() // sequence: 'bcd'