CSharp examples for System.Collections.Generic:ICollection
Collection Contains Ignoring Case
using System.Linq; using System.Collections.Generic; using System;/*from w ww . j a v a 2 s .c om*/ public class Main{ public static bool CollectionContainsIgnoringCase(ICollection<string> collection, string val) { if (collection.Contains(val)) { return true; } foreach (var f in collection) { if (String.Equals(f, val, StringComparison.InvariantCultureIgnoreCase)) { return true; } } return false; } }