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; }