Removing the last occurance of a string in javascript
<p>I have several paragraphs of text that are being stripped of all of their formatting by a javascript function.</p>

<p>I have the function doing 99% of what I need it to do already, with one minor problem.</p>

<p>At the very end of the text it is putting two &lt;br&gt;&lt;br&gt; tags that I do not want as it just adds blank white space at the end. In other areas of the text there are double &lt;br&gt; tags I want to leave in place.</p>

<p>So my question is how do I take the entire block of text and only remove the very last &lt;br&gt;&lt;br&gt; tags?</p>
