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
AFAIK, both substring() and indexOf() are supported by both Mozilla and IE. However, note that substr() might not be supported on earlier versions of some browsers (esp. Netscape/Opera).
Your post indicates that you already know how to do it using substring() and indexOf(), so I'm not posting a code sample.