I have a string that contains alphabets and integer like banana12,apple123, i wanted to separate integer value from a string. I have used split() function its working perfectly for single digit number ( orange1 ) but for double digit number it is returning only single digit.
myString = banana12;
var splits = myString.split(/(\d)/);
var prodName = splits[0];
var prodId = splits[1];
the prodId should be 12 but its returning only 1 as result.