How to remove a duplicates values from the array and list

Hi,
Sorry. I might have misunderstanding.

If your expected result is {“value1”,“value2”,“value4”} ,the following Union method works.

arrString.Union(arrString).ToArray

The above expression :

arrString.Where(Function(x) arrString.Count(function(y) y=x)=1).ToArray

returns {“value2”,“value4”}

Regards,

3 Likes