Addrange的用法

效果如下:

附代码:

cs 复制代码
 public static void List()
 {
     List<int> list = new List<int> { 1,3,5};
     List<int> list2 = new List<int> { 2, 4,6 };
     "\n原始list为:\n".Print();
     list.ForEach(x=>x.Print());//var listrange =
      list.AddRange(list);
     "\naddrange后list为:\n".Print();
     list.ForEach(x => x.Print());

 }
相关推荐
90后小陈老师11 小时前
Windows 10 下 Gitee SSH 连接配置详解(附常见问题解决)
windows·gitee·ssh
Light Gao12 小时前
MCPHub 路由原理:一个入口如何管理并调用上百个 MCP Server
windows·microsoft
郭涤生13 小时前
Windows + Ubuntu 双系统启动故障修复
linux·windows·ubuntu
看浪的路人19 小时前
第3讲:代码补全引擎
开发语言·windows·python
进击切图仔21 小时前
在 windows 和 ubuntu 中配置 host 文件
linux·windows·ubuntu
烟锁池塘柳01 天前
【亲测有效】Windows上更新NVIDIA显卡驱动的方法
windows·nvidia·显卡驱动
看浪的路人1 天前
第5讲:代码审查与 Bug 检测
开发语言·windows·python
molaoye1 天前
Windows修改系统环境变量不需要重启电脑之骚操作
windows
wling03011 天前
vasp虚频计算-python脚本
开发语言·windows·python·vasp计算
在世修行2 天前
Windows 上 Docker Desktop 部署 MySQL + TDengine 全过程(含 WSL 报错与镜像加速排障实战)
windows·mysql·docker·tdengine