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());

 }
相关推荐
程序设计实验室3 小时前
在 Windows 11 上使用 Hyper-V 虚拟机准备安装OpenClaw
windows
唐宋元明清21881 天前
.NET Win32磁盘动态卷/跨区卷触发“函数不正确”问题排查
windows·c#·存储
阿白的白日梦8 天前
winget基础管理---更新/修改源为国内源
windows
埃博拉酱12 天前
VS Code Remote SSH 连接 Windows 服务器卡在"下载 VS Code 服务器":prcdn DNS 解析失败的诊断与 BITS 断点续传
windows·ssh·visual studio code
唐宋元明清218813 天前
.NET 本地Db数据库-技术方案选型
windows·c#
加号313 天前
windows系统下mysql多源数据库同步部署
数据库·windows·mysql
tryCbest13 天前
Windows环境下配置pip镜像源
windows·pip
呉師傅13 天前
火狐浏览器报错配置文件缺失如何解决#操作技巧#
运维·网络·windows·电脑
百事牛科技13 天前
保护文档安全:PDF限制功能详解与实操
windows·pdf
一个人旅程~13 天前
如何用命令行把win10/win11设置为长期暂停更新?
linux·windows·经验分享·电脑