AGENT.Contrib.Util.Parse.TryParseInt C# (CSharp) Метод

TryParseInt() публичный статический Метод

Attempt to parse the provided string value.
public static TryParseInt ( string s, int &i ) : bool
s string String value to be parsed
i int Variable to set successfully parsed value to
Результат bool
        public static bool TryParseInt(string s, out int i)
        {
            i = 0;
            try
            {
                i = int.Parse(s);
                return true;
            }
            catch
            {
                return false;
            }
        }