TryParseUInt32() static private method

static private TryParseUInt32 ( String s, NumberStyles style, NumberFormatInfo info, UInt32 &result ) : Boolean
s String
style NumberStyles
info NumberFormatInfo
result UInt32
return Boolean
Esempio n. 1
0
        public static bool TryParse(String s, out UInt32 result)
        {
            if (s == null)
            {
                result = 0;
                return(false);
            }

            return(Number.TryParseUInt32(s.AsReadOnlySpan(), NumberStyles.Integer, NumberFormatInfo.CurrentInfo, out result));
        }
Esempio n. 2
0
        public static bool TryParse(string s, out uint result)
        {
            if (s == null)
            {
                result = 0;
                return(false);
            }

            return(Number.TryParseUInt32(s, NumberStyles.Integer, NumberFormatInfo.CurrentInfo, out result));
        }
Esempio n. 3
0
 private static bool TryParse(ReadOnlySpan <char> s, NumberStyles style, NumberFormatInfo info, out ushort result)
 {
     if (Number.TryParseUInt32(s, style, info, out uint i) != Number.ParsingStatus.OK ||
         i > MaxValue)
     {
         result = 0;
         return(false);
     }
     result = (ushort)i;
     return(true);
 }
Esempio n. 4
0
        public static bool TryParse([NotNullWhen(true)] string?s, NumberStyles style, IFormatProvider?provider, out uint result)
        {
            NumberFormatInfo.ValidateParseStyleInteger(style);

            if (s == null)
            {
                result = 0;
                return(false);
            }

            return(Number.TryParseUInt32(s, style, NumberFormatInfo.GetInstance(provider), out result) == Number.ParsingStatus.OK);
        }
Esempio n. 5
0
        public static bool TryParse(String s, NumberStyles style, IFormatProvider provider, out UInt32 result)
        {
            NumberFormatInfo.ValidateParseStyleInteger(style);

            if (s == null)
            {
                result = 0;
                return(false);
            }

            return(Number.TryParseUInt32(s.AsReadOnlySpan(), style, NumberFormatInfo.GetInstance(provider), out result));
        }
Esempio n. 6
0
        private static bool TryParse(string s, NumberStyles style, NumberFormatInfo info, out ushort result)
        {
            result = (ushort)0;
            uint result1;

            if (!Number.TryParseUInt32(s, style, info, out result1) || result1 > (uint)ushort.MaxValue)
            {
                return(false);
            }
            result = (ushort)result1;
            return(true);
        }
Esempio n. 7
0
        private static ushort Parse(ReadOnlySpan <char> s, NumberStyles style, NumberFormatInfo info)
        {
            Number.ParsingStatus status = Number.TryParseUInt32(s, style, info, out uint i);
            if (status != Number.ParsingStatus.OK)
            {
                Number.ThrowOverflowOrFormatException(status, TypeCode.UInt16);
            }

            if (i > MaxValue)
            {
                Number.ThrowOverflowException(TypeCode.UInt16);
            }
            return((ushort)i);
        }
Esempio n. 8
0
        private static bool TryParse(ReadOnlySpan <char> s, NumberStyles style, NumberFormatInfo info, out UInt16 result)
        {
            result = 0;
            UInt32 i;

            if (!Number.TryParseUInt32(s, style, info, out i))
            {
                return(false);
            }
            if (i > MaxValue)
            {
                return(false);
            }
            result = (UInt16)i;
            return(true);
        }
        // Token: 0x060014F2 RID: 5362 RVA: 0x0003DF4C File Offset: 0x0003C14C
        private static bool TryParse(string s, NumberStyles style, NumberFormatInfo info, out ushort result)
        {
            result = 0;
            uint num;

            if (!Number.TryParseUInt32(s, style, info, out num))
            {
                return(false);
            }
            if (num > 65535U)
            {
                return(false);
            }
            result = (ushort)num;
            return(true);
        }
Esempio n. 10
0
        private static bool TryParse(ReadOnlySpan <char> s, NumberStyles style, NumberFormatInfo info, out ushort result)
        {
            result = 0;
            uint i;

            if (!Number.TryParseUInt32(s, style, info, out i, out _))
            {
                return(false);
            }
            if (i > MaxValue)
            {
                return(false);
            }
            result = (ushort)i;
            return(true);
        }
Esempio n. 11
0
        private static bool TryParse(string s, NumberStyles style, NumberFormatInfo info, out ushort result)
        {
            result = 0;
            uint i;

            if (!Number.TryParseUInt32(s, style, info, out i))
            {
                return(false);
            }
            if (i > ushort.MaxValue)
            {
                return(false);
            }
            result = (ushort)i;
            return(true);
        }
Esempio n. 12
0
 public static bool TryParse(String s, NumberStyles style, IFormatProvider provider, out UInt32 result)
 {
     NumberFormatInfo.ValidateParseStyleInteger(style);
     return(Number.TryParseUInt32(s, style, NumberFormatInfo.GetInstance(provider), out result));
 }
Esempio n. 13
0
 public static bool TryParse(String s, out UInt32 result)
 {
     return(Number.TryParseUInt32(s, NumberStyles.Integer, NumberFormatInfo.CurrentInfo, out result));
 }
Esempio n. 14
0
 public static bool TryParse(ReadOnlySpan <char> s, NumberStyles style, IFormatProvider?provider, out uint result)
 {
     NumberFormatInfo.ValidateParseStyleInteger(style);
     return(Number.TryParseUInt32(s, style, NumberFormatInfo.GetInstance(provider), out result) == Number.ParsingStatus.OK);
 }
Esempio n. 15
0
 public static bool TryParse(ReadOnlySpan <char> s, out UInt32 result, NumberStyles style = NumberStyles.Integer, IFormatProvider provider = null)
 {
     NumberFormatInfo.ValidateParseStyleInteger(style);
     return(Number.TryParseUInt32(s, style, NumberFormatInfo.GetInstance(provider), out result));
 }
Esempio n. 16
0
 public static bool TryParse(ReadOnlySpan <char> s, out uint result)
 {
     return(Number.TryParseUInt32(s, NumberStyles.Integer, NumberFormatInfo.CurrentInfo, out result));
 }