I would suggest using the ToArray()
method (or just using a List
instad of an ArrayList) to take advantage of the OrderBy
and ThenBy
functions. It would look something like this:
list = list.OrderBy(/*Order it by length*/).ThenBy(/*Order alphabetically*/);