I have this html image with a source:
<img src="http://url/test/img-429x600.jpg" class="test-class">
What I need is, to remove the "-429x600" part from the source. I can achieve that using the following jquery:
var imgSrc = $('.test-class').attr("src");
imgSrc = imgSrc.replace("-429x600", "");
$('.test-class').attr("src", imgSrc);
Now my problem is, how can I remove the same string but if I don't know the numbers that will appear there. I want to be able to remove that part of the string but without specifying the exact value.