- int[] intArray = new int[] { 10, 20, 20, 12, 15, 22, 11, 45, 15, 45 };
- intArray.Distinct();
- foreach (int num in intArray)
- {
- Console.Write(num + " ");
- }
Array is a Reference type. But when I use Distinct on Array it is not affected. I am confused here. Please anyone clear it.