title: Get list of students whose first name is before their last name alphabetically
body: <p>So I have a list of students that have FirstName and LastName. How do I filter them with a LINQ query in the given way: their first name comes before last name alphabetically?</p>
  
  <p>I tried something along the lines of</p>
  
  <pre><code>var newStudents =
          from s in students
          where s.FirstName &lt; s.LastName
          select s;
  </code></pre>
  
  <p>The problem I'm facing here is that strings can't be compared that way.  </p>
  
  <p>The students also have a List of int containing their grades, with another query. I need to extract all students who have the grade 2 appear twice.<br>
  For example, I need to select a student with grades <code>{ 2, 3, 4, 5, 2 }</code> but ignore a student with grades <code>{ 2, 3, 4, 5, 6 }</code>.</p>