title: Find substrings in JavaScript string array
body: <p>I need code that will find substrings in an array of strings. This will find complete strings: </p>
  
  <pre><code>var categories = [ "msn.com", "http://gmail.com", "word2" ];
  found = $.inArray('http://gmail.com/example', categories);
  alert(found); // TRUE
  </code></pre>
  
  <p>But I want this to be true also:</p>
  
  <pre><code>var categories = [ "msn.com", "http://gmail.com", "word2" ];
  found = $.inArray('gmail.com/example', categories);
  alert(found); // FALSE
  </code></pre>