Javascript String chomp()
chomp()
String.prototype.chomp = function() { return this.replace(/(\n|\r)+$/, ''); }