How do I find best match between list<string> and list<tuple

Dec 14 2019 12:09 PM
Hi All
 
How do I find best match between list and list>> using C#
 
i am stuck in a scenario i have two list A & B. First List is string (A)
 
List
 
and second list is (B)
 
List>>
 
I wants best match of list A in B.
 
Sample code:
 
List A:
 
Hide Expand Copy Code
 
// List A
List lstA = new List();
lstA.Add("aaa");
lstA.Add("aaaaaa");
lstA.Add("bb");
lstA.Add("cc");
// List B
List>> lstB = new List>>();
List lstB1 = new List();
List lstB2 = new List();
List lstB3 = new List();
List lstB4 = new List();
List lstB5 = new List();
foreach (var md in item.mylList)
{
lstB1.Add("aaa");
lstB2.Add("aaa");
lstB2.Add("a1");
lstB3.Add("aaa");
lstB3.Add("aaaaaa");
lstB3.Add("bb");
lstB3.Add("cc");
lstB4.Add("aaa");
lstB4.Add("cc");
lstB5.Add("aaa");
lstB5.Add("bb");
lstB5.Add("cc");
}
lstB.Add(new Tuple>(1, "Test1", lstB1));
lstB.Add(new Tuple>(2, "Test2", lstB2));
lstB.Add(new Tuple>(3, "Test3", lstB3));
lstB.Add(new Tuple>(4, "Test4", lstB4));
lstB.Add(new Tuple>(5, "Test5", lstB5));

Answers (2)