Page 1 of 1

remove Hex characters from string

PostPosted: Fri Dec 20, 2013 8:01 am
by frednet
How can i remove # 0D0A from a string?
I tried all kinds of string replacements e.g.
StrReplace "[digitempwaarderuw]" "#0D0A " "[digitempwaarde]" "" ""
any ideas?
Thanks Fred.

Re: remove Hex characters from string

PostPosted: Fri Dec 20, 2013 8:37 am
by Gaev
Fred:

#0D0A is two characters (bytes) ... in NeoBook syntax it is [#13][#10] ... so try ...
Code: Select all
StrReplace "[digitempwaarderuw]" "[#13][#10]" "[digitempwaarde]" "" ""


f.y.i. Hex to Decimal ...

00 = 0
01 = 1
02 = 2

...

09 = 9
0A = 10
0B = 11
0C = 12
0D = 13
0E = 14
0F = 15
10 = 16

....

FF = 255

Note:
The syntax for the StrReplace command is ...
Code: Select all
StrReplace "string" "old chars" "new chars" "variable" "options"
... so the parameters in your posted example might not be in the correct order ... assuming that you want to "remove" the two hex bytes, perhaps ...
Code: Select all
StrReplace "[digitempwaarderuw]" "[#13][#10]" "" "[digitempwaarde]" ""

Re: remove Hex characters from string

PostPosted: Fri Dec 20, 2013 9:09 am
by frednet
[quote="Gaev"]Fred:

#0D0A is two characters (bytes) ... in NeoBook syntax it is [#13][#10] ... so try ...
Code: Select all
StrReplace "[digitempwaarderuw]" "[#13][#10]" "[digitempwaarde]" "" ""


Geav,

Thanks for the very swift response, I forgot the brackets [ ] around the #13 thats why I got totally stuck and running around in circles.
Problem solved.
Thanks for pointing me in the right way.