private static Array listToArrayRemoveEmpty(String list,String delimiter,boolean multiCharDelim){
  if (!multiCharDelim || delimiter.length() == 0)   return listToArrayRemoveEmpty(list,delimiter);
  if (delimiter.length() == 1)   return listToArrayRemoveEmpty(list,delimiter.charAt(0));
  int len=list.length();
  if (len == 0)   return new ArrayImpl();
  Array array=new ArrayImpl();
  int from=0;
  int index;
  int dl=delimiter.length();
  while ((index=list.indexOf(delimiter,from)) != -1) {
    if (from < index)     array.appendEL(list.substring(from,index));
    from=index + dl;
  }
  if (from < len)   array.appendEL(list.substring(from,len));
  return array;
}

private static Array listToArrayRemoveEmpty ( String list , String delimiter , boolean multiCharDelim ) { if ( ! multiCharDelim || delimiter . length ( ) == 0 ) return listToArrayRemoveEmpty ( list , delimiter ) ; if ( delimiter . length ( ) == 1 ) return listToArrayRemoveEmpty ( list , delimiter . charAt ( 0 ) ) ; int len = list . length ( ) ; if ( len == 0 ) return new ArrayImpl ( ) ; Array array = new ArrayImpl ( ) ; int from = 0 ; int index ; int dl = delimiter . length ( ) ; while ( ( index = list . indexOf ( delimiter , from ) ) != - 1 ) { if ( from < index ) array . appendEL ( list . substring ( from , index ) ) ; from = index + dl ; } if ( from < len ) array . appendEL ( list . substring ( from , len ) ) ; return array ; }
casts a list to array object remove empty elements
