From: Robert Klemme Date: 2009-02-21T04:24:43+09:00 Subject: Re: String#include? with several possibilities? On 20.02.2009 19:25, Aldric Giacomoni wrote: > Say I have a string like.. At random... > string = "The quick brown fox jumps over the lazy dog" > I'd like to do something like: > puts "Yes!" if string.include? ('quick', 'brown', 'lazy') > Expected behavior : if -any- of them are included, return true. > > Is that possible with a built-in method? Yes, of course! puts "Yes!" if %w[quick brown lazy].any? {|s| string.include? s} Kind regards robert