How to remove last square brackets. I have string like this:
Product[parameter][0][values][2][value]
And I need to achive string without last brackets:
Product[parameter][0][values][2]
Try like this:
var x = "Product[parameter][0][values][2][value]";
x = x.substr(0, x.lastIndexOf("["));
alert(x);