SyntaxFix
Write A Post
Hire A Developer
Questions
Use the Javascript string split() function.
var coolVar = '123-abc-itchy-knee'; var partsArray = coolVar.split('-'); // Will result in partsArray[0] == '123', partsArray[1] == 'abc', etc