Subtle List<string> Manipulation
<p>I have two <code>List&lt;string&gt;</code> (<code>listOfFullPaths</code> containg full database paths for e.g. "C:\MyDir\SomeDir\SomeDatabase.mdf") and some other <code>List&lt;string&gt;</code> containing <em>some</em> of the names of the databases (only) ('listOfDatabases'). So each might include</p>

<pre><code>List&lt;string&gt; listOfFullPaths = new List&lt;string&gt;() 
{
    "C:\MyDir\SomeDir\SomeDatabase1.mdf",
    "C:\MyDir\SomeDir\SomeDatabase2.mdf",
    "C:\MyDir\SomeDir\SomeDatabase3.mdf"
};
</code></pre>

<p>the other just</p>

<pre><code>List&lt;string&gt; listOfFullPaths = new List&lt;string&gt;() 
{
    "SomeDatabase1",
    "SomeDatabase2"
};
</code></pre>

<p>My question is <strong>what is the most efficent way of returning the full paths contined in <code>listOfFullPaths</code> that have their corresponding database in <code>listOfDatabases</code>?</strong></p>

<p>Note: The answer is <em>not</em> something like</p>

<pre><code>List&lt;string&gt; tmpList = new List&lt;string&gt;();
foreach (string database in listOfDatabases)
    if (listOfFullPaths.Contains(database))
        tmpList.Add(database);
listOfFullPaths.Clear();
listOfFullPaths = tmpList;
</code></pre>

<p>although this does what I want. </p>
