Trim underscores in Util.ToInt32 and Util.ToUInt32

Addresses Mono bug 12241.
This commit is contained in:
chenzw95
2016-04-04 21:38:12 +08:00
parent cf7ca51d83
commit b5ce2fcfcc

View File

@@ -184,11 +184,11 @@ internal static uint rnd32()
// Data Retrieval
internal static int ToInt32(string value)
{
return string.IsNullOrWhiteSpace(value) ? 0 : int.Parse(value.Trim());
return string.IsNullOrWhiteSpace(value) ? 0 : int.Parse(value.Trim(new char[2] { ' ', '_' }));
}
internal static uint ToUInt32(string value)
{
return string.IsNullOrWhiteSpace(value) ? 0 : uint.Parse(value.Trim());
return string.IsNullOrWhiteSpace(value) ? 0 : uint.Parse(value.Trim(new char[2] { ' ', '_' }));
}
internal static uint getHEXval(string s)
{