List of utility methods to do String Capitalize
ucfirst()String.prototype.ucfirst = function(){ var str = this + ''; return str.charAt(0).toUpperCase() + str.substr(1); | |
ucfirst(str)String.prototype.ucfirst = function(str) { str += ''; var f = str.charAt(0).toUpperCase(); return f + str.substr(1); }; | |
firstToUpper()String.prototype.firstToUpper = function() { return this.charAt(0).toUpperCase() + this.slice(1); | |
firstToUpper()var useful = {} String.prototype.firstToUpper = function() { return this.charAt(0).toUpperCase() + this.slice(1); Array.prototype.shuffle = function() { var currentIndex = this.length, temporaryValue, randomIndex ; while (0 !== currentIndex) { randomIndex = Math.floor(Math.random() * currentIndex); currentIndex -= 1; ... | |
firstUpper()String.prototype.firstUpper = function() { return this.charAt(0).toUpperCase() + this.slice(1); }; |