[Solved] How to extract numbers from a String into an array


First split the string. Then parse each element in String array to new array

String[] s=str.split("\\D+");
int[] intarray=new int[s.length];
for(int i=0;i<s.length;i++){
   intarray[i]=Integer.parseInt(s[i]);
}

solved How to extract numbers from a String into an array