title: Is there a way to get the difference between two sets of objects in c#
body: <p>I want to get the difference between two sets of ints in c#. Given s1 and s2 I want to return those ints which are in s1 and not in s2. I can do something such as:</p>
  
  <pre><code>    List&lt;int&gt; s1 = new List&lt;int&gt;();
      List&lt;int&gt; s2 = new List&lt;int&gt;();
  
      foreach (int i in s1)
      {
          if (s1.Contains(i))
          {
              //
          }
          else
          {
              //
          }
      }
  </code></pre>
  
  <p>But I was wondering if anyone can point out anything cleaner. I would like to do something such as </p>
  
  <pre><code>List&lt;int&gt; omitted = s1.Difference(s2);
  </code></pre>
  
  <p>Not sure if there is an existing method or a LINQ construct that anyone might be able to point out? Thank you.</p>