Remove Duplicates from Numbers Using Linq

This code will remove the duplicates from the numbers

Create a Number Array

Dim numbers() = {1, 2, 8, 5, 3, 3, 3, 3, 5, 3, 89, 9}

Use the .Distinct Method to remove the duplicates

'Assign it to a Array
Dim distinctNumbers() = numbers.Distinct().ToArray()


No responses found. Be the first to comment...

  • Do not include your name, "with regards" etc in the comment. Write detailed comment, relevant to the topic.
  • No HTML formatting and links to other web sites are allowed.
  • This is a strictly moderated site. Absolutely no spam allowed.
  • Name: