how to sort a string array by alphabet?

前端 未结 3 1961
轻奢々
轻奢々 2021-01-17 21:59

I\'ve got a array of many strings. How can I sort the strings by alphabet?

3条回答
  •  轮回少年
    2021-01-17 22:18

    Sounds like you just want to use the Array.Sort method.

    Array.Sort(myArray)
    

    There are many overloads, some which take custom comparers (classes or delegates), but the default one should do the sorting alphabetically (ascending) as you seem to want.

提交回复
热议问题