[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Re: delete row in array of arrays

Dan Diebolt

9/11/2008 6:08:00 PM

[Note: parts of this message were removed to make it a legal post.]

Two successive delete_at methods will do what you ask with the c array modified:

c=[[], [], ["BRKR", "2008-09-09, 11:08:28", "ISLAND", "-200","16.1000", "3,220.00", "-1.00", "3,446.688", "-1.0704", "0.00", ""],[]]

c.delete_at(0)
c.delete_at(0)
c

Perhaps you can get the essential info you need to manipulate with this:

c.delete([])
c.flatten!

I am not precisely sure why, but you cannot successfully chain either of the these two statements:

c.delete_at(0).delete_at(0)
c.delete([]).flatten!