CSharp examples for System.Collections.Generic:List
Distinct Strings in List
using System.Text.RegularExpressions; using System.Text; using System.Runtime.InteropServices; using System.Reflection; using System.Linq; using System.IO;/*from w w w . j a va 2 s . c o m*/ using System.ComponentModel; using System.Collections.Generic; using System; public class Main{ public static List<string> DistinctStrings(this List<string> items) { var r = new List<string>(); foreach (var item in items) { if (!r.Contains(item)) { r.Add(item); } } return r; } }