title: regex to replace &nbsp; to "" does not work - Java
body: <p>I'm trying to replace all <code>&amp;nbsp;</code> in a string with "" but the below does not seem to work.</p>
  
  <pre><code>str.replace("&amp;nbsp","");
  </code></pre>
  
  <p>My string: </p>
  
  <pre><code>&lt;img alt="" src="abc430.jpg" width="650" height="430" /&gt; u seen&amp;nbsp; &lt;a  
  href="http://www.funnyordie.com/between_two_ferns" target="_blank"&gt;&lt;/a&gt;&amp;nbsp;hey hey hey
  
  trying to get this output: 
  &lt;img alt="" src="abc430.jpg" width="650" height="430" /&gt; u seen &lt;a  
  href="http://www.funnyordie.com/between_two_ferns" target="_blank"&gt;&lt;/a&gt;hey hey hey
  </code></pre>
  
  <p>Now the replace code does replace &amp; nbsp; with "" but still my output on the page is</p>
  
  <pre><code>u seen 
  link here
  hey hey
  </code></pre>
  
  <p>It's not in one line</p>