System.Net.Http.Headers.WarningHeaderValue.TryReadAgent C# (CSharp) Method

TryReadAgent() private static method

private static TryReadAgent ( string input, int startIndex, int &current, string &agent ) : bool
input string
startIndex int
current int
agent string
return bool
        private static bool TryReadAgent(string input, int startIndex, ref int current, out string agent)
        {
            agent = null;

            int agentLength = HttpRuleParser.GetHostLength(input, startIndex, true, out agent);

            if (agentLength == 0)
            {
                return false;
            }

            current = current + agentLength;
            int whitespaceLength = HttpRuleParser.GetWhitespaceLength(input, current);
            current = current + whitespaceLength;

            // At least one whitespace required after <agent>. Also make sure we have characters left for <text>
            if ((whitespaceLength == 0) || (current == input.Length))
            {
                return false;
            }

            return true;
        }