Check if two Strings share a common substring in JavaScript
<blockquote>
  <p><strong>Possible Duplicate:</strong><br>
  <a href="http://stackoverflow.com/questions/2167602/optimum-way-to-compare-strings-in-javascript">Optimum way to compare strings in Javascript?</a>  </p>
</blockquote>



<p>Is there any fast way in JavaScript to find out if 2 Strings contain the same substring? e.g. I have these 2 Strings: "audi is a car" and "audiA8".</p>

<p>As you see the word "audi" is in both strings but we cannot find it out with a simple <code>indexOf</code> or RegExp, because of other characters in both strings.</p>
