我正在使用词典列表。我想按列值在列表中对每个Dictionary进行排序。我正在尝试这两个选项:
1)
Dim myList As List(Of Dictionary(Of Integer, Single))
myList.ForEach(Function(x) x.OrderBy(Function(a) a.Value).ToDictionary(Function(y) y.Key, Function(y) y.Value))
2)
Dim myList As List(Of Dictionary(Of Integer, Single))
For Each element In myList
element = element.OrderBy(Function(a) a.Value).ToDictionary(Function(y) y.Key, Function(y) y.Value)
Next
但是,这些都不起作用。有人可以帮帮我吗?