Remove ALL white spaces from text
<blockquote>
  <p><strong>Possible Duplicate:</strong><br>
  <a href="http://stackoverflow.com/questions/3794919/replace-all-spaces-in-a-string-with">Replace all spaces in a string with &#39;+&#39;</a>  </p>
</blockquote>



<pre><code>    $("#topNav" + $("#breadCrumb2nd").text().replace(" ", "")).addClass("current");
</code></pre>

<p>This is a snippet from my code. I want to add a class to an ID after getting another ID's text property. The problem with this, is the ID holding the text I need, contains gaps between the letters. </p>

<p>I would like the white spaces removed. I have tried <code>TRIM()</code>and <code>REPLACE()</code> but this only partially works. The <code>REPLACE()</code> only removes the 1st space.</p>

<p>Thanks a bunch in advance, I know I am missing something small.</p>
