title: How to trim specific characters from end of JavaScript string?
body: <p>In javascript, how to I do a right trim?</p>
  
  <p>I have the following:</p>
  
  <pre><code>    var s1 = "this is a test~";
  
       var s = s1.rtrim('~') 
  </code></pre>
  
  <p>but was not successful</p>