Javascript String trimUri()
trimUri()
String.prototype.trimUri = function () { return this.replace(/\/$/, ''); };