title: C# - Sorting Strings
body: <p>I have a <code>RichTextBox</code> that looks similar to this:</p>
  
  <pre><code>TEXT  TEXT-1     227.905  174.994  180  1111
  TEXT  DIFTEXT    227.905  203.244  180  9999
  TEXT  DIFTEXT2   242.210  181.294  180  2222
  TEXT  TEXT-2     236.135  198.644  90   ABC1111
  TEXT  SOMETEXT   250.610  201.594  0    DDDD
  TEXT  OTHERTEXT  269.665  179.894  180  4444
  TEXT  OTHERTEXT  269.665  198.144  180  1111
  </code></pre>
  
  <p>And I would like to sort it in a special order. Let's say I want to sort it by the last value <em>(column 6)</em> in this sequence: </p>
  
  <p><strong>1111, 2222, 4444, 9999, DDDD</strong></p>
  
  <p>AND then sort it <em>secondly</em> by the <strong><em>2nd column</em></strong> alphabetically.</p>
  
  <p>So the updated file would look like this <strong><em>NOTE: Since there is no sorting for "ABC1111" it matches the 1111 instead</em></strong>:</p>
  
  <pre><code>TEXT  OTHERTEXT  269.665  179.894  180  1111
  TEXT  TEXT-1     227.905  174.994  180  1111
  TEXT  TEXT-2     236.135  198.644  90   ABC1111   #See note above
  TEXT  DIFTEXT2   242.210  181.294  180  2222
  TEXT  OTHERTEXT  269.665  198.144  180  4444
  TEXT  DIFTEXT    227.905  203.244  180  9999
  TEXT  SOMETEXT   250.610  201.594  0    DDDD
  </code></pre>
  
  <p>And once it is in this format I would like to write it back to the <code>RichTextBox</code>.</p>
  
  <ul>
  <li>How can I do this?</li>
  </ul>