1function humanize(str) {
2 var i, frags = str.split('_');
3 for (i=0; i<frags.length; i++) {
4 frags[i] = frags[i].charAt(0).toUpperCase() + frags[i].slice(1);
5 }
6 return frags.join(' ');
7}
8
9
10humanize('humpdey_dumpdey');
11// > Humpdey Dumpdey
12