 <p>Other answers pointing to the fact that Strings are immutable are accurate.</p> <p>But if you want to have the functionality of "clearing a String", you can <a href="http://www.mkyong.com/java/how-to-clear-delete-the-content-of-stringbuffer/" rel="nofollow">use a StringBuffer instead and call this on it</a>:</p> <pre><code>stringBuffer.delete(0, stringBuffer.length()); </code></pre>