In JavaScript, I wanted to do the right trim for all the special characters at the end of the string. My Piece of code doing the trim for hyphen (-) only..Need for all the special characters(:.,()+-=/[]\@#$%^&*) as well.
var s = "DB-";
var x = s.replace(/-+$/,'');
console.log(x);
Any help on this?