AGENT.Contrib.Util.Parse.TryParseUShort C# (CSharp) Method

TryParseUShort() public static method

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
return bool
        public static bool TryParseUShort(string s, out ushort i)
        {
            i = 0;
            try
            {
                i = ushort.Parse(s);
                return true;
            }
            catch
            {
                return false;
            }
        }