Sorting a List of Strings numerically (1,2,…,9,10 instead of 1,10,2)

前端 未结 3 411
鱼传尺愫
鱼传尺愫 2020-12-06 05:35

I have a List like this:

var l = new List {\"bla 1.txt\",\"bla 2.txt\",\"bla 10.txt\",\"bla 3.txt\"};

If i call l.Sort(), the

3条回答
  •  感情败类
    2020-12-06 05:46

    The best approach is making use of IComparer. This has already been done and can be found on code project.

提交回复
热议问题