I have a string of words; let\'s call them bad:
bad
bad = \"foo bar baz\"
I can keep this string as a whitespace separated string,
bad = %w(foo bar baz) str = "This is my first foo string" # find the first word in the list found = bad.find {|word| str.include?(word)} # remove it str[found] = '' ;# str => "This is my first string"