title: Scrubbing strings in Java
body: <p>I have a series of strings in the following format:  </p>
  
  <pre><code>String a = "Agregator par. L1-23 2/22.--------&gt;EFM Actelis ML628  8-210  alternative 8-/208                                                        ";
  </code></pre>
  
  <p>As you can see, the original format doesn't look very good, so I would like to remove parts of the string to give the following result:</p>
  
  <pre><code>"Agregator par. L1-23 2/22.EFM Actelis ML628  8-210  alternative 8-/208"
  </code></pre>
  
  <p>Not all of my strings follow this exact format, however, which means they're not simple to manipulate.</p>
  
  <p>Here's what I want to do:</p>
  
  <ul>
  <li>Remove all trailing blank spaces (about 56 of them, but not always the same number)</li>
  <li>Remove all occurrences of <code>--------&gt;</code>, without removing hyphens from other parts of the string. The number of hyphens in <code>--------&gt;</code> may vary between strings</li>
  </ul>