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

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

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