title: Removing whitespace from strings in Java
body: <p>I have a string like this: </p>
  
  <pre><code>mysz = "name=john age=13 year=2001";
  </code></pre>
  
  <p>I want to remove the whitespaces in the string. I tried <code>trim()</code> but this removes only whitespaces before and after the whole string. I also tried <code>replaceAll("\\W", "")</code> but then the <code>=</code> also gets removed.</p>
  
  <p>How can I achieve a string with:</p>
  
  <pre><code>mysz2 = "name=johnage=13year=2001"
  </code></pre>