Look for various substrings and return the position of the one found
<p>I want to analize a string for a substring and return the position of the substring if it was found.</p>

<pre><code>function analize(t) {
    if (t.indexOf(" a ") &gt; -1 || t.indexOf(" b ") &gt; -1 || t.indexOf(" c ") &gt; -1) {
        alert(t.indexOf(" a "));
        }
</code></pre>

<p>The problem is that I'm looking for more than one substring and I cant echo its position since I don't know which was found. While this example only has 3 strings, I need to do it with a lot more in my code. How can I check for various items and return the position of the one that's found?</p>
