toUpperCase
优质
小牛编辑
137浏览
2023-12-01
Converts all of the characters in this string to uppercase.
Signature
StringLikeSequence.toUpperCase = function() { /*...*/ }
StringLikeSequence.toUpperCase = function toUpperCase() { return this.mapString(function(char) { return char.toUpperCase(); }); }
Name | Type(s) | Description |
---|---|---|
returns | StringLikeSequence | A new sequence with the same characters as this sequence, all uppercase. |
Examples
function nextLetter(a) { return String.fromCharCode(a.charCodeAt(0) + 1); } Lazy('foo').toUpperCase() // sequence: 'FOO' Lazy('foo').substring(1).toUpperCase() // sequence: 'OO' Lazy('abc').mapString(nextLetter).toUpperCase() // sequence: 'BCD'