How to sort elements of array list in C#

后端 未结 9 1095
梦如初夏
梦如初夏 2021-02-14 23:42

I have an ArrayList that contains,

[0] = \"1\"
[1] = \"10\"
[2] = \"2\"
[3] = \"15\"
[4] = \"17\"
[5] = \"5\"
[6] = \"6\"
[7] = \"27\"
[8] = \"8\"
[9] = \"9\"
         


        
9条回答
  •  梦如初夏
    2021-02-15 00:20

     List liDllCnt = new List();
     for (int temp = 0; temp < alFileName.Count; temp++)
         liDllCnt.Add(Int32.Parse(alFileName[temp].ToString()));
     liDllCnt.Sort();
    

    alFileName is the name of the arraylist that i used.

提交回复
热议问题