title: LINQ: How do I compare two elements?
body: <p>I have a list of strings and if one element is a substring of another element, I want to remove that shorter element. </p>
  
  <p>So, </p>
  
  <pre><code>{abc, def, ghi, ab, cd, ef} =&gt; {abc, def, ghi, cd}
  </code></pre>
  
  <p>I tried: </p>
  
  <pre><code>list = list.Where((x, y) =&gt; x.Item1 != y.Item1 &amp;&amp; x.Item1.Contains(y.Item1) == false);
  </code></pre>
  
  <p>but somehow <code>y</code> is an integer.</p>