Need to parse MDN's that have extra characters

I am receiving MDN's that have too many digits at the beginning, I need to parse them down to 10 digits using JavaScript. Can anyone give me examples of how to do this?