I have 2 list of String Header1 and Header2
List<String> Header1 = new List<String>();
Header1.add("String1");
Header1.add("String2");
Header1.add("String3");
Header1.add("String4");
and
List<String> Header2 = new List<String>();
Header2.add("STRING1");
Header2.add("STRING2");
I would like to remove these entries "String1" and "String2" in Header2 from Header1 by ignoring the case sensitivity.
Any idea how to do it either using LINQ or string operation as well.
Thanks
Header1.RemoveAll(x =>
Header2.Contains(x, StringComparer.CurrentCultureIgnoreCase));
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With