How to replace all from a certain letter?
<p>I want to be able to replace from a letter to the end or to the start.</p>

<p>Lets say i have a string: <code>i love apples</code> i want to be able to search for <code>a</code> which is the beginning of <code>apples</code> and from there replace everything before it! So i am left with apples. Same goes for, search for <code>a</code> and replace everything from a upwards so i am left with <code>i love</code></p>

<p>My JS only finds word and delete, how do i make it do the above? Thanks!</p>

<p>JS:</p>

<pre><code>var queuestring2 = $(this).html();
queuestring2 = queuestring2.replace("path", "");
$(this).html(queuestring2);
</code></pre>