Source language: Translate to:

remove Hex characters from string

Questions about using NeoBook's scripting language

Moderator: Neosoft Support

remove Hex characters from string

Postby frednet » Fri Dec 20, 2013 8:01 am

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.
User avatar
frednet
 
Posts: 83
Joined: Fri Sep 23, 2005 4:29 am
Location: netherlands

Re: remove Hex characters from string

Postby Gaev » Fri Dec 20, 2013 8:37 am

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]" ""
User avatar
Gaev
 
Posts: 3738
Joined: Fri Apr 01, 2005 7:48 am
Location: Toronto, Canada

Re: remove Hex characters from string

Postby frednet » Fri Dec 20, 2013 9:09 am

[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.
User avatar
frednet
 
Posts: 83
Joined: Fri Sep 23, 2005 4:29 am
Location: netherlands


Return to NeoBook Action Commands

Who is online

Users browsing this forum: No registered users and 1 guest

cron