Beispiel #1
0
        public static int IndexOfIgnoreCase <TEnum>(this EnumIteratedList <string, TEnum> strings, char value)
            where TEnum : struct, IConvertible, IComparable, IFormattable
        {
            int j = -1;

            for (int i = 0; i < strings.Length; i++)
            {
                bool same = String.Equals(value.ToString(), strings[i], StringComparison.OrdinalIgnoreCase);
                if (same)
                {
                    j = i;
                    return(j);
                }
            }
            return(j);
        }
Beispiel #2
0
        public static int IndexOfIgnoreCase <TEnum>(this EnumIteratedList <char, TEnum> chars, string value)
            where TEnum : struct, IConvertible, IComparable, IFormattable
        {
            int j = -1;

            for (int i = 0; i < chars.Length; i++)
            {
                string charAsStr = chars[i].ToString();
                bool   same      = String.Equals(value, charAsStr, StringComparison.OrdinalIgnoreCase);
                if (same)
                {
                    j = i;
                    return(j);
                }
            }
            return(j);
        }