如何在vb.net中对KeyValuePair列表进行排序

时间:2018-02-28 04:21:05

标签: asp.net .net vb.net

我想在vb.net中对Keyvluepair列表的值进行排序 这是c#示例正在运行,

static int Compare1(KeyValuePair<string, string> a, KeyValuePair<string, string> b)
{
    return a.Key.CompareTo(b.Key);
}

postparamslist.Sort(Compare1);

但是在vb中它不起作用: -

Public Function Compare1(ByVal a As KeyValuePair(Of String, String), ByVal b As KeyValuePair(Of String, String)) As Integer
    Return a.Key.CompareTo(b.Key)
End Function

0 个答案:

没有答案