list<T> 排序方法之一
2008-11-12 11:11
218 查看
Code
private List<int> listRowspan = new List<int>();//用于保存所有标题列的跨行数
/// <summary>
/// 跨行数排序类
/// </summary>
class SortRowspan : IComparer<int>
{
public int Compare(int x, int y)
{
if (x > y)
{
return 1;
}
else if (x < y)
{
return -1;
}
else
{
return 0;
}
}
}
listRowspan.Sort(new SortRowspan());//
private List<int> listRowspan = new List<int>();//用于保存所有标题列的跨行数
/// <summary>
/// 跨行数排序类
/// </summary>
class SortRowspan : IComparer<int>
{
public int Compare(int x, int y)
{
if (x > y)
{
return 1;
}
else if (x < y)
{
return -1;
}
else
{
return 0;
}
}
}
listRowspan.Sort(new SortRowspan());//
相关文章推荐
- List<T>的各种排序方法
- List<T>的各种排序方法
- List<T>泛型数组API自带的Sort() 排序方法根据自定义排序实现
- List<T>在搜索和排序时采用不同方法的性能比较
- 定义一个静态方法,该方法可以接收一个List<Integer>,方法内对List进行排序
- Java List<>排序——重载Collections.sort方法
- C# List<T>自定义排序方法
- List<T>的各种排序方法
- VS2010使用扩展方法对List<T>进行随机排序
- List<T>的各种排序方法
- Gridview 绑定泛型List<T> 排序方法
- List<T>的各种排序方法
- C# List<T> 自定义排序方法
- Java关于List<String> 进行排序,重写Comparator()方法
- List<T>的各种排序方法
- C#泛型集合List<T>自带方法之排序
- (转)List<T>的各种排序方法
- List<T>的各种排序方法
- 深入理解 c# 第一章 使用扩展方法对 List<Product> 排序
- list<T>.Sort()排序方法汇总