From: Daniel Webb Date: 2009-11-24T01:36:13+09:00 Subject: Best way to search through an array for an item matching a s Hi everyone, am trying to find a nice easy/simple way to - search through an array of strings match the string I've input - use that index to print out the word before in the array. for example [ahoy there,hello,me hearties,dear friends] 'hello' should output 'ahoy there' http://pastie.org/711384 I'm hoping there's a way of doing this without regexp... Thanks very much, Dan -- Posted via http://www.ruby-forum.com/.