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

 }
相关推荐
星间都市山脉4 小时前
Android16 SystemService.onBootPhase 调用时机
android·java·linux·windows·ubuntu
小羊没烦恼!5 小时前
Memory 记忆设计讨论:为什么 Agent Memory 不能只靠向量数据库?
java·开发语言·windows·算法·c#
公子小六9 小时前
基于.NET的Windows窗体编程之WinForms自定义控件(1)
windows·.net
江湖人称菠萝包1 天前
【Windows】《深入浅出Windows API程序设计:核心编程篇》笔记-Chapter4-进程
windows·笔记
www.021 天前
Codex额度用完怎么办?Windows定时自动继续VS Code Codex任务实战
人工智能·windows·vscode·自动化·openai·codex·autohotkey
StarDream-Online1 天前
Windows 下 uv 安装与配置完全指南(含环境变量设置)
windows·uv
空 白II1 天前
cuda toolkit 10.0 windows 安装实录
windows
名字还没想好☜1 天前
Java Collectors.groupingBy 进阶:多级分组、下游收集器与统计聚合一次搞定
java·windows·后端·python·spring
漂着的圆木1 天前
模型应用Gemini登陆Windows:Alt+Space唤起
windows
csdn_aspnet1 天前
如何从电脑主机拷东西到VWmare虚拟机
linux·运维·服务器·windows·vmware·虚拟机