title: Removing whitespaces from string and removing them from char array
body: <p>I have an input that recieves a String in java:</p>
  
  <pre><code>"a                                                a" 
  </code></pre>
  
  <p>(50 characters total, 2 letters and 48 whitespaces)</p>
  
  <p>when i tried </p>
  
  <pre><code>replace("\\s++","");
  </code></pre>
  
  <p>or</p>
  
  <pre><code>replaceAll("\\s+","");
  </code></pre>
  
  <p>removes the whitespaces, but keeps on the string(char array) with '\u0000' 0
  How i remove this to make the string only with 2 characters?</p>