title: Remove whitespaces only from the right side of a String
body: <p>I have a <code>String printerName;</code> which is 256 characters long. I need to remove whitespaces from right side of the String so that I get only a valid printer name. </p>
  
  <p>This solution:</p>
  
  <pre><code>st.replaceAll("\\s+","")
  </code></pre>
  
  <p>doesn't work, because a valid printerName can have a whitespaces. And I don't know how many characters I have to delete, becouse there can be many printers. What's the best solution for this?</p>