js substring after -' code example
Example 1: javascript substring after character
var testStr = "sometext-20202"
var splitStr = testStr.substring(testStr.indexOf('-') + 1);
Example 2: javascript substring after character
const str = 'sometext-20202';
const slug = str.split('-').pop();