+2002-05-02 Gonzalo Paniagua Javier <gonzalo@ximian.com>
+
+ * Int32.cs:
+ * Int64.cs:
+ * UInt32.cs:
+ * UInt64.cs (Parse): don't use Char.IsNumber to test for hex digits.
+
2002-05-01 Duncan Mak <duncan@ximian.com>
* Convert.cs:
return false;
}
+ private static bool is_hex (char e)
+ {
+ return Char.IsDigit (e) || (e >= 'A' && e <= 'F') || (e >= 'a' && e <= 'f');
+ }
+
public static int Parse (string s, NumberStyles style, IFormatProvider fp)
{
if (s == null)
IsAnything validDigit;
if (AllowHexSpecifier)
- validDigit = new IsAnything (Char.IsNumber);
+ validDigit = new IsAnything (is_hex);
else
validDigit = new IsAnything (Char.IsDigit);
return false;
}
+ private static bool is_hex (char e)
+ {
+ return Char.IsDigit (e) || (e >= 'A' && e <= 'F') || (e >= 'a' && e <= 'f');
+ }
+
public static long Parse (string s, NumberStyles style, IFormatProvider fp)
{
if (s == null)
IsAnything validDigit;
if (AllowHexSpecifier)
- validDigit = new IsAnything (Char.IsNumber);
+ validDigit = new IsAnything (is_hex);
else
validDigit = new IsAnything (Char.IsDigit);
return false;
}
+ private static bool is_hex (char e)
+ {
+ return Char.IsDigit (e) || (e >= 'A' && e <= 'F') || (e >= 'a' && e <= 'f');
+ }
+
[CLSCompliant(false)]
public static uint Parse (string s, NumberStyles style, IFormatProvider fp)
{
IsAnything validDigit;
if (AllowHexSpecifier)
- validDigit = new IsAnything (Char.IsNumber);
+ validDigit = new IsAnything (is_hex);
else
validDigit = new IsAnything (Char.IsDigit);
return false;
}
+ private static bool is_hex (char e)
+ {
+ return Char.IsDigit (e) || (e >= 'A' && e <= 'F') || (e >= 'a' && e <= 'f');
+ }
+
[CLSCompliant(false)]
public static ulong Parse (string s, NumberStyles style, IFormatProvider fp)
{
IsAnything validDigit;
if (AllowHexSpecifier)
- validDigit = new IsAnything (Char.IsNumber);
+ validDigit = new IsAnything (is_hex);
else
validDigit = new IsAnything (Char.IsDigit);