Sort a list alphabetically

前端 未结 5 1222
故里飘歌
故里飘歌 2020-12-08 01:19

I have the following class:

class Detail
{
    public Detail()
    {
        _details = new List();
    }
    public IList Detail         


        
5条回答
  •  南笙
    南笙 (楼主)
    2020-12-08 02:17

    There are two ways:

    Without LINQ: yourList.Sort();

    With LINQ: yourList.OrderBy(x => x).ToList()

    You will find more information in: http://www.dotnetperls.com/sort-string-array

提交回复
热议问题