title: Replacing smiley codes in strings
body: <p>I am inserting smileys into strings. I have encoded the smileys in a certain format and when before I display the string in a component I need to replace all occurrences of the smiley codes with HTML img tags so they will show up as images. So here is the format of my smileys -</p>
  
  <pre><code>&amp;:) ==&gt; smile
  
  &amp;:O ==&gt; shocked
  
  &amp;:( ==&gt; sad
  
  etc...
  </code></pre>
  
  <p>So say I have the following string -</p>
  
  <p><code>Did you hear the news &amp;:O. I won a million dollars!! &amp;:)</code></p>
  
  <p>I need to find, and then replace all the smiley codes with HTML like </p>
  
  <p><code>&lt;img src='file:C:/images/sad.png'/&gt;</code></p>