C#List自定义排序

List<words_info> word_info_pre_line = new List<words_info>();  
class words_info           //自字义类型
    {
       public  string word = null;
       public double rank = 0.0;
       public int TF = 0;
    }

word_info_pre_line.Sort(my_sort);     //用自定义的排序规则排序


private static int my_sort(words_info A, words_info B)   //自己重写排序规则。
        {
            return B.rank.CompareTo(A.rank);
        }


你可能感兴趣的:(c,String,list,null,Class)