Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- String.prototype.ucfirst = function()
- {
- return this.charAt(0).toUpperCase() + this.substr(1).toLocaleLowerCase();
- }
- String.prototype.ucwords = function()
- {
- var arr = this.split(' ');
- arr.forEach(function(e, i, a){ a[i] = e.ucfirst(); });
- return arr.join(' ');
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement