Remove .jpg extension from path
<p>What is the less expensive solution to remove ".jpg" extension from path, for example</p>

<pre><code>lib/img/img.jpg  &gt; lib/img/img
</code></pre>

<p>I will use it in loop 6 times, thats why i need a lightweight solution.</p>
