【发布时间】:2021-11-27 08:15:53
【问题描述】:
假设我有以下两个列表:
list1=["Equipment ONLY - Bees Technologies","Bees Technologies","Chris Metal SA - Central Office","NSA Aerospace tech"]
list2=["Bees Tech, Inc.","Chris Metal, SA","NSA Arerospace"]
如何合并这两个列表以获得以下结果:
final_list=["Equipment ONLY - Bees Technologies","Bees Technologies", "Bees Tech, Inc.", "Chris Metal SA - Central Office", "Chris Metal, SA","NSA Aerospace tech", "NSA Arerospace"]
【问题讨论】:
-
final_list = list1 + list2? -
如果列表 1 中的每个项目都对应于列表 2 中的一个项目,您可以使用 Levensthein Distance 或类似的方法来确定它对应的项目并进行相应的排序。
-
var list3 = list1.Union(list2).ToList();