string 转化成int[]

public static int[] string_to_int(String str){
             

           String[] strAry = str.split(",");
          
           int[] intAry = new int[strAry.length];
          
           for(int i = 0; i < strAry.length; i++){
          
           try{
           intAry[i] = Integer.parseInt(strAry[i].trim());
           // System.out.println(intAry[i]);

          
           }catch (NumberFormatException nbFmtExp){
           intAry[i] = 0;
           }
           }


作者: zhengdong1987   发布时间: 2010-12-04