title: Sorting a List in C# using List.Sort(Comparison<T> comparison
body: <p>I have created a class as follows:</p>
  
  <pre><code>public class StringMatch
  {
     public int line_num;
     public int num_of_words;
  }
  </code></pre>
  
  <p>I have created a list</p>
  
  <pre><code>List&lt;StringMatch&gt; sm;
  </code></pre>
  
  <p>it has few elements in it.</p>
  
  <p>How do I sort this list using the <code>Comparison&lt;T&gt;</code> comparison overload?
  The sorting must be done based on the <code>num_of_words</code> field.</p>