Javascript String snake_case()
case()
String.prototype.snake_case = function(){ return this/* w w w.j a v a2s . co m*/ .replace( /[A-Z]/g, function($1) { return '_' + $1 } ) .toLowerCase(); }