var the_string = "sometext-20202";var parts = the_string.split('-', 2);// After calling split(), 'parts' is an array with two elements:// parts[0] is 'sometext'// parts[1] is '20202'var the_text = parts[0];var the_num = parts[1];
↧
Answer by Sean Bright for Get everything after the dash in a string in JavaScript
↧