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]


-- 
Posted via http://www.ruby-forum.com/.