On Monday 23 October 2006 14:27, Li Chen wrote: > Hi all, > > I have an array of [1,2,''] I want change it to [1,2]. I check the > document about Array but I can't find a way to remove the empty element. > Any comments? > > Thanks, > > Li You can Array#reject! if you want to do it in-place or Array#delete_if if you want to capture the non-empty elements on a new Array instance. Cheers Ulisses Montenegro -- "The reasonable man adapts himself to the world; the unreasonable one persists in trying to adapt the world to himself. Therefore all progress depends on the unreasonable man." (George Bernard Shaw)