SyntaxFix
Write A Post
Hire A Developer
Questions
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];