String[] strs = str.split("");for(String s:strs){str +=s+",";}或者String[] strs=str.toCharArray();str=strs.toString().replaceAll("[^0-9]","");
自己参考下