Skip to content

List Extensions

Andrzej Kebab edited this page Jan 21, 2024 · 2 revisions

UtilityLibrary.Core

RemoveDuplicates

Removes duplicate elements from a list.

using UtilityLibrary.Core;
using System.Collections.Generic;

List<int> list = new List<int> { 1, 2, 3, 3, 4, 5, 5, 5 };
list.RemoveDuplicates();

// Result: list = [1, 2, 3, 4, 5]

Clone this wiki locally