From b5ce2fcfcc2c02fe9cc9338f90af9af95c533893 Mon Sep 17 00:00:00 2001 From: chenzw95 Date: Mon, 4 Apr 2016 21:38:12 +0800 Subject: [PATCH] Trim underscores in Util.ToInt32 and Util.ToUInt32 Addresses Mono bug 12241. --- Misc/Util.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Misc/Util.cs b/Misc/Util.cs index 251c101b5..e23b18fdb 100644 --- a/Misc/Util.cs +++ b/Misc/Util.cs @@ -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) {