using System.Collections.Generic;
public static void Main()
var source = new string[] {"A","B","C","111","11","123","1","42","5"};
var sorted = source.OrderBy(x => x, new Comparer());
Console.WriteLine(string.Join("\n", sorted));
public class Comparer : IComparer<string>
public int Compare(string a, string b)
var aIsInt = int.TryParse(a,out ia);
var bIsInt = int.TryParse(b,out ib);