- using System;
- using System.Collections.Generic;
- using Sorting.CSharpStringSort;
- namespace SortTests.Sorting
- {
- public class sfList : List<string>
- {
- public sfList() : base() { }
- public sfList(int size) : base(size) { }
- public sfList(IEnumerable<String> aArray) : base(aArray) { }
- public new void Sort()
- {
- //StringSort.Sort(this);
- string[] a = this.ToArray();
- this.Clear();
- //sort array and refill contents of this (faster than directly sorting List)
- StringSort.Sort(ref a);
- this.AddRange(a);
- }
- }
- }
- //该片段来自于http://www.codesnippet.cn/detail/2007201513155.html
来源: http://www.codesnippet.cn/detail/2007201513155.html