title: What's the fastest way to check if a word from one string is in another string?
body: <p>I have a string of words; let's call them <code>bad</code>:</p>
  
  <pre><code>bad = "foo bar baz"
  </code></pre>
  
  <p>I can keep this string as a whitespace separated string, or as a list:</p>
  
  <pre><code>bad = bad.split(" ");
  </code></pre>
  
  <p>If I have another string, like so:</p>
  
  <pre><code>str = "This is my first foo string"
  </code></pre>
  
  <p>What's the fasted way to check if any word from the <code>bad</code> string is within my comparison string, <strong>and</strong> what's the fastest way to remove said word if it's found?</p>
  
  <pre><code>#Find if a word is there
  bad.split(" ").each do |word|
    found = str.include?(word)
  end
  
  #Remove the word
  bad.split(" ").each do |word|
    str.gsub!(/#{word}/, "")
  end
  </code></pre>