Javascript String trimRight(charlist)
String.prototype.trimRight = function (charlist) { if (charlist === undefined) charlist = "\s"; return this.replace(new RegExp("[" + charlist + "]+$"), ""); };