title: Sorting a list of numeric strings with numerous decimal points
body: <p>I've got a situation where I need to sort a list of strings that contain three decimal parts in descending order from left-to-right. The real code is a dictionary of <code>&lt;string, object&gt;</code>, but I've simplified it here as I'm in the same predicament either way.</p>
  
  <p>Straight to the code:</p>
  
  <pre><code>using System;
  using System.Collections.Generic;
  
  class Program
  {
      static void Main()
      {
          List&lt;string&gt; perlVersions = new List&lt;string&gt;();
  
          perlVersions.Add("5.26.1_32");
          perlVersions.Add("5.24.1_32");
          perlVersions.Add("5.8.1_64");
          perlVersions.Add("5.24.2_64");
  
          perlVersions.Sort();
          perlVersions.Reverse();
          foreach (string str in perlVersions) Console.WriteLine(str);
      }
  }
  </code></pre>
  
  <p>Output:</p>
  
  <pre><code>5.8.1_64
  5.26.1_32
  5.24.2_64
  5.24.1_32
  </code></pre>
  
  <p>Now, Everything works well, except that the <code>5.8.1_64</code>, due to the second part of the number being lower than all others, should be at the bottom.</p>
  
  <p>Is there a special sorting trick I'm missing, or is there a way to further break apart the strings and sort on each individual element?</p>