public static List<T>  Swap<T>(this List<T> list, int index1,int index2)
{
if(index1<0||index1>=list.Count)
{
throw new Exception("index1");
}
if (index2 < 0 || index2 >= list.Count)
{
throw new Exception("index2");
}
var temp = list[index1];
list[index1] = list[index2];
list[index2] = temp;
return list;
}

  

最新文章

  1. CSS3 3D立方体效果-transform也不过如此
  2. yii2 RESTful api的详细使用
  3. Loadrunner ---集合点设置
  4. Web框架们
  5. ios资源
  6. 独立博客开张!有关读书、GTD和IT方面的内容将发布在新网站上
  7. html中怎么去掉input获取焦点时候的边框
  8. python study - 正则表达式
  9. 自定义 SharePoint 2010 快速启动栏和顶部链接栏
  10. 底部菜单栏(三)Fragment+FragmentTabHost实现仿新浪微博底部菜单栏
  11. Cocos2d-x 3.1.1 学习日志9--一“上一下其乐无穷”游戏开发系列一
  12. 用JS添加和删除class类名
  13. JVM GC算法
  14. 写的还不错的专题,android性能优化
  15. Java 保留两位小数填坑
  16. 【CSS学习】--- float浮动属性
  17. Oracle函数——日期函数
  18. PHP-1安装配置
  19. 基于python+appium+yaml安卓UI自动化测试分享
  20. Kibana加载样本数据

热门文章

  1. 大数据中HBase的Java接口封装
  2. iOS逆向+越狱
  3. @RestController注解
  4. electron快速开始
  5. Shuffle Bags让你的随机不那么随机
  6. Window10家庭版启动hyper-v虚拟机组件
  7. windows的滚动条使用
  8. kali获得windows的shell后乱码
  9. 2017秋软工 —— 本周PSP
  10. java.util.ConcurrentModificationException: null