BitOrchestra.Parser.AcceptNewline C# (CSharp) Method

AcceptNewline() public static method

Tries parsing a newline in the given text.
public static AcceptNewline ( string Text, int &Index ) : bool
Text string
Index int
return bool
        public static bool AcceptNewline(string Text, ref int Index)
        {
            bool found = false;
            while(Index < Text.Length)
            {
                char c = Text[Index];
                switch (c)
                {
                    case '\r':
                    case '\n':
                        found = true;
                        Index++;
                        continue;
                    default:
                        return found;
                }
            }
            return found;
        }