From: Aaron Patterson Date: 2007-06-26T10:01:55+09:00 Subject: Re: Looking for a match On Tue, Jun 26, 2007 at 07:44:14AM +0900, Ari Brown wrote: > Hey, > I'm looking to match a string to another string ANYWHERE in a new > file. For instance, my code looks like such: > > if readlines[*] == chosen_one # If there's a match - > next # Boil some brains (try > again) > end You should check out Enumerable#any?. I think that is what you are looking for. For example: if readlines.any? { |line| line == chosen_one } ... end -- Aaron Patterson http://tenderlovemaking.com/