JavaScript - how can I check if a string is part or equal to another string
<p>Just to illustrate what I want to do I'll pase this sample code for example:</p>

<pre><code>&lt;html&gt;
&lt;head&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;script type="text/javascript"&gt;
function oc(a)
{
  var o = {};
  for(var i=0;i&lt;a.length;i++)
  {
    o[a[i]]='';
  }
  return o;
}
if ( "Island" in oc(["Hello","Hello World","Have","Island"]) )
{
document.write("Yes");
}
&lt;/script&gt;
&lt;/body&gt;
&lt;/html&gt; 
</code></pre>

<p>In this case I get <code>Yes</code> on my page, but if I change the condition like:</p>

<blockquote>
  <p>if ( "Isl" in oc(["Hello","Hello World","Have","Island"]) )</p>
</blockquote>

<p>the function doesn't find match. What is the best way to perform such kind of check which will return true even if only part of the string match?</p>

<p>Thanks</p>

<p>Leron</p>
