From: Daniel Webb Date: 2009-11-24T20:55:45+09:00 Subject: Re: Best way to search through an array for an item matching a s Thanks Jeremy. That works a treat, however if I'm using an array populated by values from a text file I get: undefined method `-' for nil:NilClass (NoMethodError) I've tried flattening the array but it didn't make any difference (as that's caused issues in the past), but to it's no use. Using IRB I can see it's putting in new line characters when it's stripping the line. i.e. "arrrrrrgh!\n" I presume this is what is producing the error, does anyone know a way around this error? Thanks very much, Dan -- Posted via http://www.ruby-forum.com/.