System::Collections::Generic::List::Sort method

List::Sort() method

使用默认比较器对列表中的元素进行排序。

void System::Collections::Generic::List<T>::Sort()

另见

List::Sort(Comparison<T>, bool) method

对列表中的元素进行排序。

void System::Collections::Generic::List<T>::Sort(Comparison<T> comparison, bool)
参数类型描述
comparisonComparison<T>要使用的 Comparison

另见

List::Sort(const SharedPtr<System::Collections::Generic::IComparer<T>>&) method

对列表中的元素进行排序。

void System::Collections::Generic::List<T>::Sort(const SharedPtr<System::Collections::Generic::IComparer<T>> &comparator)
参数类型描述
比较器const SharedPtr<System::Collections::Generic::IComparer<T>>&要使用的比较器。

另见

List::Sort(int, int, SharedPtr<System::Collections::Generic::IComparer<T>>) method

对列表切片中的元素进行排序。

void System::Collections::Generic::List<T>::Sort(int index, int count, SharedPtr<System::Collections::Generic::IComparer<T>> comparator)
参数类型描述
索引int切片起始索引。
countint切片大小。
比较器SharedPtr<System::Collections::Generic::IComparer<T>>要使用的比较器。

另见