public static int[] intArrayFromString(String string){
  List<Integer> result=new ArrayList<Integer>(10);
  if (StringUtils.isNotBlank(string)) {
    RaptorStringTokenizer tok=new RaptorStringTokenizer(string,",",false);
    while (tok.hasMoreTokens()) {
      try {
        result.add(Integer.parseInt(tok.nextToken()));
      }
 catch (      NumberFormatException nfe) {
        throw new IllegalStateException(nfe);
      }
    }
  }
  int[] arrayResult=new int[result.size()];
  for (int i=0; i < result.size(); i++) {
    arrayResult[i]=result.get(i);
  }
  return arrayResult;
}

public static int [ ] intArrayFromString ( String string ) { List < Integer > result = new ArrayList < Integer > ( 10 ) ; if ( StringUtils . isNotBlank ( string ) ) { RaptorStringTokenizer tok = new RaptorStringTokenizer ( string , "," , false ) ; while ( tok . hasMoreTokens ( ) ) { try { result . add ( Integer . parseInt ( tok . nextToken ( ) ) ) ; } catch ( NumberFormatException nfe ) { throw new IllegalStateException ( nfe ) ; } } } int [ ] arrayResult = new int [ result . size ( ) ] ; for ( int i = 0 ; i < result . size ( ) ; i ++ ) { arrayResult [ i ] = result . get ( i ) ; } return arrayResult ; }
returns an int [ ] from a string formatted in what tostring ( int [ ] ) returns .
