Skip to content

Commit

Permalink
Replace slashes and leading spaces when converting HEX strings to UInt
Browse files Browse the repository at this point in the history
  • Loading branch information
TomMuehlegger committed Nov 26, 2024
1 parent daaa484 commit 72f493e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion LibNoDaveConnectionLibrary/PLCs/S7_xxx/MC7/Helper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -410,7 +410,7 @@ static public int GetIntFromHexString(string myString)
static public uint GetUIntFromHexString(string myString)
{
uint val = 0;
foreach (char tmp in myString.ToLower().Replace("dw#16#", "").Replace("w#16#", "").Replace("b#16#", "").Replace("\t", ""))
foreach (char tmp in myString.ToLower().Replace("//", "").Replace("dw#16#", "").Replace("w#16#", "").Replace("b#16#", "").Replace("\t", "").Trim())
{
val *= 16;
switch (tmp)
Expand Down

0 comments on commit 72f493e

Please sign in to comment.