将两个列表连接在一起

本文探讨了如何在C#中快速合并两个列表,特别是字符串类型的列表,同时保持原有顺序并去除重复项。讨论了使用'Union'扩展方法、'Concat'方法以及'AddRange'方法的不同特点和适用场景。
摘要由CSDN通过智能技术生成

本文翻译自:Joining two lists together

If I have two lists of type string (or any other type), what is a quick way of joining the two lists? 如果我有两个类型字符串列表(或任何其他类型),加入这两个列表的快速方法是什么?

The order should stay the same. 订单应该保持不变。 Duplicates should be removed (though every item in both links are unique). 应删除重复项(尽管两个链接中的每个项都是唯一的)。 I didn't find much on this when googling and didn't want to implement any .NET interfaces for speed of delivery. 谷歌搜索时我没有找到太多,并且不想实现任何.NET接口以提高交付速度。


#1楼

参考:https://stackoom.com/question/6PXv/将两个列表连接在一起


#2楼

Something like this: 像这样的东

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值