From: Austin Ziegler Date: 2006-10-24T02:36:06+09:00 Subject: Re: How to remove empty element in an array On 10/23/06, 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 cant't find a way to remove the empty > element. Any comments? It's "[1, 2, ]"? If so, then it's not an empty element. If you have [1, 2, nil] then you can just use Array#compact or Array#compact!. Otherwise, look at #delete_if. -- Austin Ziegler * halostatue@gmail.com * http://www.halostatue.ca/ * austin@halostatue.ca * http://www.halostatue.ca/feed/ * austin@zieglers.ca