 <p>It would be better if you sorted the objects you are populating richtextbox1 with instead of trying to split and parse the text of richtextbox1.</p> <p>Lets say you have a list with students</p> <pre><code>List&lt;Student&gt; studentList = new List&lt;Student&gt;(); </code></pre> <p>That list could be sorted by using something similar to this:</p> <pre><code>StringBuilder sb = new StringBuilder(); studentList.OrderByDescending(x=&gt;x.Average) .ToList() .ForEach(x=&gt; sb.Append(String.Format("{0} {1} {2} {3} {4}" + Environment.NewLine,x.Id,x.Name,x.Sname,x.DOB,x.Average))); richTextBox2.Text = sb.ToString(); </code></pre>