c# How to sort a sorted list by its value column
问题 i have a generic sorted list "results" with key = some filename and value = boolean. I would like to sort the list by the boolean entry or value column. does anyone know how i can do this? Thanks! 回答1: SortedList is optimized so that inertions occur in an ordered fashion, such that enumeration occurs in a sorted order at minimal cost. Anything else requires a re-sort. Thus: SortedList<string,bool> l=new SortedList<string, bool>(); l.Add("a",true); l.Add("a",false); l.Add("b",true); l.Add("b"