title: Is there any functions in String which can to help delete all spaces in string?
body: <p>Is there any functions in <code>String</code> which can to help delete all spaces in string? I wouldn't like to use a method like this.</p>
  
  <pre><code>private String deleteSpace(String string) {
      String newString = "";
      for(int i = 0;i &lt; string.length();i++)
          if(string.charAt(i) != ' ')
              newString += String.valueOf(string.charAt(i));
      return newString;
  }
  </code></pre>
  
  <p>Thank you for any help.</p>