title: Merge Sorting a String Array in C#
body: <p>I am attempting to program an array sorting and searching program that will be handling 600 items within a string array.The data which is to be sorted looks as such:</p>
  
  <blockquote>
    <p>2017  |  25  |  January     |  9994750  |  27.640  |  36.800  |  DODECANESE ISLANDS, GREECE     |  1485307173  |  01:19:33  |  4.000  |</p>
  </blockquote>
  
  <p>I have been attempting to implement a merge sort to sort this data. However, I am unable to figure out how to convert a merge sort program designed for an int array into one designed for sorting a string array. Could anyone explain how I could do this?</p>
  
  <p>Though this can be done via the use of existing built in functions I have been attempting this in preparation for university courseworks next years and so I am having to program the Merge sort from scratch and not use the built in functions.</p>
  
  <p>Side note: I must note that I am aware that in its current form the program could not sort months naturally even with the merge sort but that is something I already have a work round for once I can get the merge sort operating as intended.</p>
  
  <p>The current merge sort program:</p>
  
  <pre><code>        static public void MainMerge(string[] numbers, int left, int mid, int right)
      {
          int[] temp = new int[25];
          int i, eol, num, pos;
  
          eol = (mid - 1);
          pos = left;
          num = (right - left + 1);
  
          while ((left &lt;= eol) &amp;&amp; (mid &lt;= right))
          {
              if (numbers[left].CompareTo(numbers[mid]))
                  temp[pos++] = numbers[left++];
              else
                  temp[pos++] = numbers[mid++];
          }
  
          while (left &lt;= eol)
              temp[pos++] = numbers[left++];
  
          while (mid &lt;= right)
              temp[pos++] = numbers[mid++];
  
          for (i = 0; i &lt; num; i++)
          {
              numbers[right] = temp[right];
              right--;
          }
      }
  
      static public void SortMerge(string[] numbers, int left, int right)
      {
          int mid;
  
          if (right &gt; left)
          {
              mid = (right + left) / 2;
              SortMerge(numbers, left, mid);
              SortMerge(numbers, (mid + 1), right);
  
              MainMerge(numbers, left, (mid + 1), right);
          }
      }
  </code></pre>