title: How to sort large numbers stored in a string array?
body: <p>I need to sort the large numbers stored as string in string array but my algorithm and .net built Array sort method doesn't work.</p>
  
  <p>I tried to convert the number into <code>long</code> or <code>ulong</code> but that throw exception of overflow.</p>
  
  <p>Here is the code that I tried: </p>
  
  <pre><code>string[] unsorted = { "1","2","100","12303479849857341718340192371",
                        "3084193741082937","3084193741082938","111","200" };
  
  for (int index = 0; index &lt; unsorted.Length - 1; index++)
  {
      for (int count = 0; count &lt; unsorted.Length - index - 1; count++)
      {
          if (string.Compare(unsorted[count], unsorted[count + 1]) == 1)
          {
              string temp = unsorted[count];
              unsorted[count] = unsorted[count + 1];
              unsorted[count + 1] = temp;
          }
      }
  }
  </code></pre>
  
  <p>Also used the following method:</p>
  
  <pre><code> Array.Sort(unsorted);
  </code></pre>
  
  <p>The array should be sorted correctly.</p>