public static Array listToArrayRemoveEmpty ( String list , char delimiter ) { int len = list . length ( ) ; ArrayImpl array = new ArrayImpl ( ) ; if ( len == 0 ) return array ; int last = 0 ; for ( int i = 0 ; i < len ; i ++ ) { if ( list . charAt ( i ) == delimiter ) { if ( last < i ) array . appendEL ( list . substring ( last , i ) ) ; last = i + 1 ; } } if ( last < len ) array . appendEL ( list . substring ( last ) ) ; return array ; }
casts a list to Array object remove Empty Elements