title: linq compare with previous item
body: <p>I need to filter a list, by removing all items have the same language code as the item before (the items are orderd by time). This way, I want to detect all border crossings.</p>
  
  <p>Is there a way to do this with one line of linq? </p>
  
  <pre><code>var test = new List&lt;Sample&gt; {   new Sample("AT", "test1"),
                                  new Sample("AT", "test2") ,
                                  new Sample("AT", "test3") ,
                                  new Sample("DE", "test4") ,
                                  new Sample("DE", "test5") ,
                                  new Sample("DE", "test6") ,
                                  new Sample("AT", "test7") ,
                                  new Sample("AT", "test8") ,
                                  new Sample("AT", "test9") 
                              };
  
  
  var borderChanges = new List&lt;Sample&gt;();
  var lastCountry = ""; 
  foreach (var sample in test)
  {
      if (sample.country != lastCountry)
      {
          lastCountry = sample.country;
          borderChanges.Add(sample);
      }
  }
  </code></pre>