I have a list of strings which contains months of the year. I need to be able to sort this list so the months are in order by month, not alphabetically. I have been search
You can use a Dictionary instead, using the int as a month number for sorting, then sorting by key.
Dictionary
int
IDictionary monthList = new Dictionary(); monthList.Add(6, "June"); monthList.Add(2, "February"); monthList.Add(8, "August"); var sorted = monthList.OrderBy(item => item.Key);