Working with List

m3rt*

New Member
I have two list : (Note: List's Items are combination of "NAME" & "ID" )\[code\]List<string> ListA = new List() {"SAM001","SAM002","SAM003","PIT001","PIT002","PIT004","ROSE001","ROSE002","JASE001" };//so onList<string> ListB = new List() {"SAM001","SAM003","PIT000","ROSE002","JASE001","INDI000"};` //so on...\[/code\]Now Based on these two list i want to create two new list suppose listCommon & listUncommon.listCommon will contain all matched items of ListA & ListB.listUnCommon will contain all remaining items of ListANow : My condition is if Any item in ListB has NAME + 000 then all the items of ListA starting with that Name (Note : no need to match ID its last 3 of ever item) should add in my listCommon.So as above list and my condition i want my final list below\[code\]List<string> listCommon = new List() {"SAM001","SAM003", "PIT001","PIT002","PIT004","ROSE002", "JASE001" };List<string> listUncommon = new List() {"SAM002", "ROSE001"};\[/code\]Please suggest..i just spend my couple of minutes in loops but not getting actual result as i mentioned :(
 
Back
Top