I created a class called tagNoMatchList that has fields tag, col, and msg.
public class tagErrorsClass
{
public string tag { get; set; }
public string col { get; set; }
public string msg { get; set; }
}
I created a List of tagNoMatchList as shown below.
var tagNoMatchList = new List<tagErrorsClass>();
Now want to sort the list on col. The code below sorts the list, but not the way that I want.
tagNoMatchList.Sort((x, y) => x.col.CompareTo(y.col));
If col contains "A29", "A21", "A52", "A16", and "A6", after sorting I get "A16", "A21", "A29", "A52", "A6". I want "A6" at the beginning of the list not at the end. Do I have to split the col string into letter (A) and number and sort each, or is there a built in comparison that will make this easier?