ParseInt() public static method

Attempt to parse a string representation of an int.
public static ParseInt ( string value ) : int
value string
return int
Example #1
0
        public static int ReadInt32(NetworkBinaryReader reader)
        {
            object value = ReadNonnullObject("int", reader);

            if (value is int || value is short || value is byte)
            {
                return((int)value);
            }
            if (value is string)
            {
                return(PrimitiveParser.ParseInt((string)value));
            }
            throw PrimitiveParser.CreateProtocolViolationException("int", value);
        }
        public static int ReadInt32(NetworkBinaryReader reader)
        {
            object value = ReadNonnullObject("int", reader);

            if (value is int || value is short || value is byte)
            {
                return((int)value);
            }
            if (value is string)
            {
                return(PrimitiveParser.ParseInt((string)value));
            }
            PrimitiveParser.InvalidConversion("int", value);
            return(0);
        }