mirror of
https://github.com/kwsch/PKHeX
synced 2025-02-17 13:58:33 +00:00
Fix String->Int conversion with spaces in middle
Replace instead of trim, then trim.
This commit is contained in:
parent
3539bf6af0
commit
ffa044d4db
1 changed files with 4 additions and 2 deletions
|
@ -184,11 +184,13 @@ namespace PKHeX
|
|||
// Data Retrieval
|
||||
internal static int ToInt32(string value)
|
||||
{
|
||||
return string.IsNullOrWhiteSpace(value) ? 0 : int.Parse(value.Trim(' ', '_'));
|
||||
string val = value?.Replace(" ", "").Replace("_", "").Trim();
|
||||
return string.IsNullOrWhiteSpace(val) ? 0 : int.Parse(val);
|
||||
}
|
||||
internal static uint ToUInt32(string value)
|
||||
{
|
||||
return string.IsNullOrWhiteSpace(value) ? 0 : uint.Parse(value.Trim(' ', '_'));
|
||||
string val = value?.Replace(" ", "").Replace("_", "").Trim();
|
||||
return string.IsNullOrWhiteSpace(val) ? 0 : uint.Parse(val);
|
||||
}
|
||||
internal static uint getHEXval(string s)
|
||||
{
|
||||
|
|
Loading…
Add table
Reference in a new issue