CSharp examples for System.Collections.Generic:IDictionary
Dictionary Get Value Ignoring Case
using System.Linq; using System.Collections.Generic; using System;//from www . j a v a 2 s .c om public class Main{ public static string DictionaryGetValueIgnoringCase(IDictionary<string, string> dictionary, string key) { if (dictionary.ContainsKey(key)) { return dictionary[key]; } foreach (var f in dictionary.Keys) { if (String.Equals(f, key, StringComparison.InvariantCultureIgnoreCase)) { return dictionary[f]; } } return null; } }