From: Aldric Giacomoni Date: 2009-11-24T01:52:28+09:00 Subject: Re: Best way to search through an array for an item matching a s Aldric Giacomoni wrote: > > def print_element_before_x_in_y x, y # Shut up. I am GOOD at method > names. index = y.index x index.nil? ? nil : y[x-1] > end What? I proofread my code. -- Posted via http://www.ruby-forum.com/.