private int[] toIntArray(String input){
  int[] result={};
  if (input.length() > 0) {
    String beforeSplit=input.replaceAll("\\[|\\]|\\s","");
    String[] split=beforeSplit.split("\\,");
    result=new int[split.length];
    for (int i=0; i < split.length; i++) {
      result[i]=Integer.parseInt(split[i]);
    }
  }
  return result;
}

private int [ ] toIntArray ( String input ) { int [ ] result = { } ; if ( input . length ( ) > 0 ) { String beforeSplit = input . replaceAll ( "\\[|\\]|\\s" , "" ) ; String [ ] split = beforeSplit . split ( "\\," ) ; result = new int [ split . length ] ; for ( int i = 0 ; i < split . length ; i ++ ) { result [ i ] = Integer . parseInt ( split [ i ] ) ; } } return result ; }
convert result of arrays . tostring ( int [ ] ) back into int [ ]
