marcusshepp
5/27/2016 - 1:05 PM

Ruby Does This String Include Any

Ruby Does This String Include Any

## string include?
string = "marcus is my name"
bad_words = ["foo", "bar", "marcus"]
if bad_words.any? { | w | string.include? w }
  puts "yes"
else
  puts "no"
end