title: Trimming multiple characters in a string
body: <p>My program reads some strings from file which have to be post processed. The original text in the file looks like</p>
  
  <pre><code>A1DY^
  BLKSS^
  "GH67^"^
  </code></pre>
  
  <p>Where <code>^</code> is the space character I used to demonstrate. As you can see all words in the file end with space. Some words are in double quote. I want to store these strings in my program</p>
  
  <pre><code>A1DY
  BLKSS
  GH67
  </code></pre>
  
  <p>In other words, I want to trim all spaces and double quotes. If I use <code>str.trim();</code> it will remove the last space. So, the third line will be <code>"GH67^"</code>. I also used <code>str.replaceAll("^\"|\"$", "");</code> to trim the double quotes. The result is <code>GH67^</code>. That means, I have to trim it again.</p>
  
  <p>Is there any better way to remove all spaces and double quotes at once? Note that I don't want to extract alphanumeric characters. I want to trim special characters.</p>