What would be the cleanest way of doing this that would work in both IE and firefox.
My string looks like this: sometext-20202
Now the \'sometext\' and the
You can do it with built-in RegExp(pattern[, flags]) Factory Notation in js like this:
RegExp(/-(.*)/).exec("sometext-20202")[1]
in above code exec function will return an array with two elements (["-20202", "20202"]) one with hyphen(-20202) and one without hyphen(20202) , you should pick second element (index 1)