Alsing.SourceCode.Pattern.IndexIn C# (CSharp) Method

IndexIn() public method

Returns the index of the pattern in a string
public IndexIn ( string text, int startPosition, bool matchCase, string separators ) : PatternScanResult
text string The string in which to find the pattern
startPosition int Start index in the string
matchCase bool true if a case sensitive match should be performed
separators string
return PatternScanResult
        public PatternScanResult IndexIn( string text, int startPosition, bool matchCase, string separators)
        {
            if (separators == null) { }
            else
            {
                this.Separators = separators;
            }

            if (!this.IsComplex)
            {
                if (!this.IsKeyword)
                    return this.SimpleFind(text, startPosition, matchCase);

                return this.SimpleFindKeyword(text, startPosition, matchCase);
            }
            if (!this.IsKeyword)
                return this.ComplexFind(text, startPosition);

            return this.ComplexFindKeyword(text, startPosition);
        }