Skip to content

Commit 72f493e

Browse files
committed
Replace slashes and leading spaces when converting HEX strings to UInt
1 parent daaa484 commit 72f493e

File tree

1 file changed

+1
-1
lines changed
  • LibNoDaveConnectionLibrary/PLCs/S7_xxx/MC7

1 file changed

+1
-1
lines changed

LibNoDaveConnectionLibrary/PLCs/S7_xxx/MC7/Helper.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -410,7 +410,7 @@ static public int GetIntFromHexString(string myString)
410410
static public uint GetUIntFromHexString(string myString)
411411
{
412412
uint val = 0;
413-
foreach (char tmp in myString.ToLower().Replace("dw#16#", "").Replace("w#16#", "").Replace("b#16#", "").Replace("\t", ""))
413+
foreach (char tmp in myString.ToLower().Replace("//", "").Replace("dw#16#", "").Replace("w#16#", "").Replace("b#16#", "").Replace("\t", "").Trim())
414414
{
415415
val *= 16;
416416
switch (tmp)

0 commit comments

Comments
 (0)