public static Array listToArrayTrim(String list,char delimiter,int[] info){
  if (list.length() == 0)   return new ArrayImpl();
  while (list.indexOf(delimiter) == 0) {
    info[0]++;
    list=list.substring(1);
  }
  int len=list.length();
  if (len == 0)   return new ArrayImpl();
  while (list.lastIndexOf(delimiter) == len - 1) {
    info[1]++;
    list=list.substring(0,len - 1 < 0 ? 0 : len - 1);
    len=list.length();
  }
  return listToArray(list,delimiter);
}

public static Array listToArrayTrim ( String list , char delimiter , int [ ] info ) { if ( list . length ( ) == 0 ) return new ArrayImpl ( ) ; while ( list . indexOf ( delimiter ) == 0 ) { info [ 0 ] ++ ; list = list . substring ( 1 ) ; } int len = list . length ( ) ; if ( len == 0 ) return new ArrayImpl ( ) ; while ( list . lastIndexOf ( delimiter ) == len - 1 ) { info [ 1 ] ++ ; list = list . substring ( 0 , len - 1 < 0 ? 0 : len - 1 ) ; len = list . length ( ) ; } return listToArray ( list , delimiter ) ; }
casts a list to array object , remove all empty items at start and end of the list
