title: How to find the first occurrence of a substring in a list of substrings?
body: <p>I have a <code>List&lt;string&gt;</code> of substrings that <em>may</em> or may not be contained in a larger main string. Ex:</p>
  
  <pre><code>List&lt;string&gt; subStringList = new List&lt;string&gt;(){" at ", " @ "," near "," by "," above "};
  List&lt;string&gt; searchStringList = new List&lt;string&gt;{
  "GULF ISLAND POND NEAR LEWISTON, ME",
  "South Branch Raritan River near High Bridge NJ",
  "Susquehanna R near Browns Island at Dalmatia, PA",
  "PARKS CREEK AT LYLE FIELD RD NEAR JEFFERSON, GA",
  "HOMOSASSA R AT HOMOSASSA FL",
  "ST. CLAIR RIVER NEAR ROBERTS LANDING, MI"
  };
  </code></pre>
  
  <p>What I want to do is to find the element of <code>subStringList</code> which occurs <strong>first</strong> in a given search string and then return the searchString up to that point.</p>
  
  <p>For example:</p>
  
  <pre><code>List&lt;string&gt; riverList = new List&lt;string&gt;();
  foreach (var seachString in searchStringList)
  {
      string river = seachString.ToLower();
      int minIndex = int.MaxValue;
      foreach (var subString in subStringList.Select(r =&gt; r.ToLower()).AsEnumerable())
      {
           var index = river.IndexOf(subString);
           if (index != null &amp;&amp; index &gt; -1 &amp;&amp; index &lt; minIndex)
               minIndex = index;
       }
           riverList.Add(seachString.Substring(0,minIndex));
  }
  </code></pre>
  
  <p>The output should look something like this: </p>
  
  <pre><code>[0]: "GULF ISLAND POND"
  [1]: "South Branch Raritan River"
  [2]: "Susquehanna R"
  [3]: "PARKS CREEK"
  [4]: "HOMOSASSA R"
  [5]: "ST. CLAIR RIVER"
  </code></pre>
  
  <p>The code I have seems to work but is there a more efficient way to do something like this and how could something like this be done with Linq?</p>