【发布时间】:2017-10-07 17:44:03
【问题描述】:
/// 有效列表
List<List<string>> newTestList = new List<List<string>>();
t.Add(new List<string>() { "A", "A" });
t.Add(new List<string>() { "B", "WILDCARD", "A" });
List<string> testList = new List<string>() { "O", "A", "A", "B", "O", "A" };
List<List<string>> t = new List<List<string>>();
t.Add(new List<string>() { "A", "A" });
t.Add(new List<string>() { "B", "W", })
t.Add(new List<string>() { "A","S" });
List<string> cart = new List<string>() { "O", "A", "A", "B", "O", "A","S" };
//无效列表
List<List<string>> t = new List<List<string>>();
t.Add(new List<string>() { "A", "A" });
t.Add(new List<string>() { "B", "W", "A","D" });
List<string> cart = new List<string>() { "O", "A", "A", "B", "O", "A" };
List<List<string>> t = new List<List<string>>();
t.Add(new List<string>() { "A", "A" });
t.Add(new List<string>() { "A","B", "W", "A","D" });
List<string> cart = new List<string>() { "O", "A", "A", "B", "O", "A" };
如何将 testList 中的值与 newTestList 中的值进行比较。
我想将 testList 中的值与 newTestList 进行比较。 testlist 中的第二个元素与 newTestList 中第一个列表的第一个元素匹配 第三个元素与第二个元素匹配,第四个元素与 newTestList 中第二个列表的第一个元素匹配,依此类推,它与 testList 中的所有元素匹配顺序。 "WILDCARD" 可以匹配任何元素
【问题讨论】:
-
我建议编辑答案并包含一些带有输入数据和预期结果的示例。另请阅读如何创建Minimal, Complete, and Verifiable example