On Tuesday 24 October 2006 00:02, Seth E. wrote:
> Li Chen wrote:
> > 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?
>
> How about this?
>
> irb(main):201:0> arr = [1,2,'']
> => [1, 2, ""]
> irb(main):202:0> arr -= ['']
> => [1, 2]

<off-topic>
I am new to the list, and have so far tried to keep myself as a silent lurker 
hidden on the corner, but coming from a Perl background (5+ years) and seeing 
this beautiful piece of code really makes me feel confident about leaving old 
habits and joining the Ruby club.
</off-topic>

-- 
"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)