title: Remove blank lines at the end of a String in Java?
body: <p>I get file's content as a String:</p>
  
  <pre><code>Test1 2.00 04/03/2016
  Test2 2.00 04/03/2016
  Test3 2.00 04/03/2016
  
       END
  </code></pre>
  
  <p>Just imagine that END is not there. I had to put it so that stackoverflow doesn't trim the blank line at the end on its own. Anyway, what would be the best way to quickly remove these blank lines just from the end of the file? Any blank lines in the middle of start of the file have to persist. Any blank spaces or tabs to the right of the text lines also have to persist.</p>