System.Net.Http.Headers.ProductInfoHeaderValue.TryParse C# (CSharp) Method

TryParse() public static method

public static TryParse ( string input, ProductInfoHeaderValue &parsedValue ) : bool
input string
parsedValue ProductInfoHeaderValue
return bool
        public static bool TryParse(string input, out ProductInfoHeaderValue parsedValue)
        {
            int index = 0;
            object output;
            parsedValue = null;

            if (ProductInfoHeaderParser.SingleValueParser.TryParseValue(input, null, ref index, out output))
            {
                if (index < input.Length)
                {
                    // There is some invalid leftover data. Normally BaseHeaderParser.TryParseValue would 
                    // handle this, but ProductInfoHeaderValue does not derive from BaseHeaderParser.
                    return false;
                }
                parsedValue = (ProductInfoHeaderValue)output;
                return true;
            }
            return false;
        }