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

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

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