|
We can extend the String prototype- String.prototype.upper=function(){return this.split(' ').map(str=>str[0].toUpperCase()+(function(x){var arr=x.split('');arr.shift();return arr.join('')})(str).toLowerCase()).join(' ')}
复制代码 and use it like this:- "THE CONVERSE OF ABEL'S THEOREM ON POWER SERIES By J. E. LITTLEWOOD.".upper()
复制代码 Output:- "The Converse Of Abel's Theorem On Power Series By J. E. Littlewood."
复制代码 |
|