How I would do this:
// function you can use:function getSecondPart(str) { return str.split('-')[1];}// use the function:alert(getSecondPart("sometext-20202"));
How I would do this:
// function you can use:function getSecondPart(str) { return str.split('-')[1];}// use the function:alert(getSecondPart("sometext-20202"));