Reputation:
I have a string array(strLarge) containing 5 values say 1,2,3,4,5. I have another string(strSmall) containing a value say 3.
Now I need to remove this strSmall from strLarge and finally get the result as 1,2,4,5.
Upvotes: 1
Views: 2484
Reputation: 187050
strLarge.Except(strSmall);
in LINQ
Produces the set difference of two sequences.
See
Upvotes: 3
Reputation: 1089
string[] strLarge = { "1", "2", "3", "4", "5" };
string[] strSmall = { "3" };
strLarge = strLarge.Where(x => !strSmall.Contains(x)).ToArray();
Upvotes: 1