Sort 方法
 本文由机器翻译。若要查看英语原文，请勾选“英语”复选框。 也可将鼠标指针移到文本上，在弹出窗口中显示英语原文。 翻译 英语

# Array.Sort 方法

.NET Framework (current version)

Sorts the elements in a one-dimensional array.

## 重载列表

Sort(Array)

Sort(Array, Array)

Sort(Array, Array, IComparer)

Sort(Array, Array, Int32, Int32)

Sort(Array, Array, Int32, Int32, IComparer)

Sort(Array, IComparer)

Sort(Array, Int32, Int32)

Sort(Array, Int32, Int32, IComparer)

Sort<T>(T[])

Sort<T>(T[], Comparison<T>)

Sorts the elements in an Array using the specified Comparison<T>.

Sort<T>(T[], IComparer<T>)

Sort<T>(T[], Int32, Int32)

Sort<T>(T[], Int32, Int32, IComparer<T>)

Sort<TKey, TValue>(TKey[], TValue[])

Sorts a pair of Array objects (one contains the keys and the other contains the corresponding items) based on the keys in the first Array using the IComparable<T> generic interface implementation of each key.

Sort<TKey, TValue>(TKey[], TValue[], IComparer<TKey>)

Sort<TKey, TValue>(TKey[], TValue[], Int32, Int32)

Sorts a range of elements in a pair of Array objects (one contains the keys and the other contains the corresponding items) based on the keys in the first Array using the IComparable<T> generic interface implementation of each key.

Sort<TKey, TValue>(TKey[], TValue[], Int32, Int32, IComparer<TKey>)