I have a rather large list of strings that contains duplicates in the sense that if I only care if A,B,C are in a result, but not what order they are in. I looked for many other duplication removal solutions, but they typically only work for exact values(which I understand since these elements aren't exact dups, but more spurious or superfluous results.) I already have the list and didn't create it, so changing the selection is not an option.
Simply sort the elements within each item first.
listOfStrings.Select(s => new string(s.OrderBy(c => c))).Distinct().ToList();
You see what I mean - sort the chars. I'll check the syntax of this momentarily..
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