I have a collection of file names with part of the pathname being a specific word. I can order the collection like this :
var files = from f in checkedListBox1.CheckedItems.OfType<string>()
orderby f.Substring(0,3)
select f;
But now, I want to sort not by alphabetical order on the pathname part but according to specific order given by another collection.
So let's say the pathname part can be "ATE", "DET" and "RTI". I have another string collection : {"DET", "ATE", "RTI"} that I want to use to sort the filenames so that after sorting, filenames appear with their partname in the order "DET" first, then "ATE", then "RTI". How do I achieve this -> need to use an own comparer ?