c# - 2 Lists of Different Length used to Create 3rd List -
I have a list that is similar to the structure (the data will be in the letters):
| A | B | C | D | E | F | G | I also have another list:
| A. B E G. I want to create a third list which is the same length as before, but in the other columns there are names named "null", which are not present in the second list, like:
| A. B Faucet Nool | E Faucet G. How can I get it?
You can do something with rows:
var List1 = new list & lt; String & gt; () {"A", "B", "C", "D", "E", "F" "G"}; Var list2 = new list & lt; String & gt; () {"A", "B", "E", "G"}; Var list3 = New list & lt; String & gt; (); Int j = 0; {Var item = list1 [i] for (int i = 0; i & lt; list1.Count; i ++); If (item == list2 [ja]) {list3.Add (item); J ++; } And {list3.Add (null); }}
Comments
Post a Comment