public static int IndexOfFirst(this IStringMatch stringMatch, string text)
        {
            if (stringMatch == null)
            {
                throw new ArgumentNullException("stringMatch");
            }

            if (text == null)
            {
                throw new ArgumentNullException("text");
            }

            for (int i = 0; i < text.Length; ++i)
            {
                stringMatch.Next(text[i]);
                if (stringMatch.IsFinal)
                {
                    return(i - stringMatch.Length + 1);
                }
            }

            return(-1);
        }
Exemplo n.º 2
0
 public StringMatch Add(IStringMatch match)
 {
     matchList.Add(match);
     return(this);
 }