From: Simen Edvardsen Date: 2006-05-28T03:59:09+09:00 Subject: Re: Basic ruby looping question You can use Array#select to get the values you want: for row in @large_row_array.select{ |row| row.element == "something" } something end On 5/27/06, Marston A. wrote: > I'm trying to do something regarding looping through an array, but only > with elements I need. I'm not sure exactly how to go about it to make it > the most efficient. Is there basically a way to do something like: > > for row in @large_row_array WHERE row.element == "something" > ... some some stuff > end > > What would be the best way to accomplish the above? Would I use perhaps > some nested loops? Thanks for any help, I'm just getting started with > Ruby along with more indepth programming in general and I'm loving it. > > -- > Posted via http://www.ruby-forum.com/. > >