How to remove the end of a string, starting from a given pattern?
<p>let's say I have a string like this:</p>

<pre><code>var str = "/abcd/efgh/ijkl/xxx-1/xxx-2";
</code></pre>

<p>How do I with Javascript/jquery remove the part of the string above starting with <code>xxx</code>, till the end of the string from that string?</p>

<p>Thanks for any suggestions</p>
