// Token: 0x0600308A RID: 12426 RVA: 0x000B9BF8 File Offset: 0x000B7DF8
        internal static int LastIndexOfStringOrdinalIgnoreCase(string source, string value, int startIndex, int count)
        {
            if (value.Length == 0)
            {
                return(startIndex);
            }
            int result = -1;

            if (TextInfo.TryFastFindStringOrdinalIgnoreCase(8388608, source, startIndex, value, count, ref result))
            {
                return(result);
            }
            int num = startIndex - count + 1;

            if (value.Length > 0)
            {
                startIndex -= value.Length - 1;
            }
            while (startIndex >= num)
            {
                if (TextInfo.CompareOrdinalIgnoreCaseEx(source, startIndex, value, 0, value.Length, value.Length) == 0)
                {
                    return(startIndex);
                }
                startIndex--;
            }
            return(-1);
        }
Ejemplo n.º 2
0
        internal static int LastIndexOfStringOrdinalIgnoreCase(string source, string value, int startIndex, int count)
        {
            if (value.Length == 0)
            {
                return(startIndex);
            }
            int foundIndex = -1;

            if (TextInfo.TryFastFindStringOrdinalIgnoreCase(8388608, source, startIndex, value, count, ref foundIndex))
            {
                return(foundIndex);
            }
            int num = startIndex - count + 1;

            if (value.Length > 0)
            {
                startIndex -= value.Length - 1;
            }
            for (; startIndex >= num; --startIndex)
            {
                if (TextInfo.CompareOrdinalIgnoreCaseEx(source, startIndex, value, 0, value.Length, value.Length) == 0)
                {
                    return(startIndex);
                }
            }
            return(-1);
        }
        // Token: 0x06003089 RID: 12425 RVA: 0x000B9B90 File Offset: 0x000B7D90
        internal static int IndexOfStringOrdinalIgnoreCase(string source, string value, int startIndex, int count)
        {
            if (source.Length == 0 && value.Length == 0)
            {
                return(0);
            }
            int result = -1;

            if (TextInfo.TryFastFindStringOrdinalIgnoreCase(4194304, source, startIndex, value, count, ref result))
            {
                return(result);
            }
            int num  = startIndex + count;
            int num2 = num - value.Length;

            while (startIndex <= num2)
            {
                if (TextInfo.CompareOrdinalIgnoreCaseEx(source, startIndex, value, 0, value.Length, value.Length) == 0)
                {
                    return(startIndex);
                }
                startIndex++;
            }
            return(-1);
        }
Ejemplo n.º 4
0
        internal static int IndexOfStringOrdinalIgnoreCase(string source, string value, int startIndex, int count)
        {
            if (source.Length == 0 && value.Length == 0)
            {
                return(0);
            }
            int foundIndex = -1;

            if (TextInfo.TryFastFindStringOrdinalIgnoreCase(4194304, source, startIndex, value, count, ref foundIndex))
            {
                return(foundIndex);
            }
            for (int index = startIndex + count - value.Length; startIndex <= index; ++startIndex)
            {
                if (TextInfo.CompareOrdinalIgnoreCaseEx(source, startIndex, value, 0, value.Length, value.Length) == 0)
                {
                    return(startIndex);
                }
            }
            return(-1);
        }