Andwho.Windows.Helper.Convert.ToInt32 C# (CSharp) Method

ToInt32() public static method

将 object 类型转换为 int
如果转换失败,则返回 0
public static ToInt32 ( object obj ) : int
obj object 需要转换的数值
return int
        public static int ToInt32(object obj)
        {
            int result = 0;
            Int32.TryParse(obj.ToString(), out result);
            return result;
        }

Same methods

Convert::ToInt32 ( string str ) : int