Here you can find the source of humanize()
String.prototype.humanize = function() { var str;//from w w w . j a v a2 s . c o m str = this.replace(/_id$/, "").replace(/_/g, ' ').replace(/([a-z\d]*)/gi, function(match) { return match.toLowerCase(); }); return str.split('.').pop(); };
String.prototype.humanize=function(){ return this[0].toUpperCase()+this.replace(/_/g," ").slice(1); };
String.prototype.humanize = function() { var str; str = this.replace(/_id$/, "").replace(/_/g, ' ').replace(/([a-z\d]*)/gi, function(match) { return match; }); return str.split('.').pop().charAt(0).toLowerCase() + str.split('.').pop().slice(1); };
String.prototype.humanize = function () var str = this; for (var i = 0; i < str.length; i++) if (str[i] == str[i].toUpperCase()) str = str.substr(0, i) +' '+ str[i].toLowerCase() + str.substr(i + 1); i++; ...
String.prototype.humanize = function() { var s = this.trim().toLowerCase().replace(/[_]+/g, ' '); s = s.replace(/^(.)|\s(.)/g, function($1) { return $1.toUpperCase(); }); return s;
String.prototype.humanize = function(){ var list = this.strip().split('_') first = list[0][0].toUpperCase() + list[0].substr(1,list[0].length) list = [first].concat(list.slice(1,list.length)) return list.join(' ').replace(/\s+/g,' ')