How to erase Hex value 13 from string?

T

Taomica

How to erase Hex value 13 from string?

Perl line : $b =~ tr/\013//;
dont work?!

Thanks
 
T

Taomica

Thanks "It work!!!"
Super.


Warren Block said:
\013 is octal. 0x0D = 13 = \015. Better to use \r if you mean carriage
return, though. And as Gunnar said, you need the d modifier:

$b =~ tr/\r//d;
 
S

Sisyphus

Paul Lalli said:
Function calls do not interpolate.

I must not reply to usenet posts while inebriated.
I must not reply to usenet posts while inebriated.
I must not reply to usenet posts while inebriated.
I must not reply to usenet posts while inebriated.
..
..
I must not reply to usenet posts while inebriated.
I must not reply to usenet posts while inebriated.
I must not reply to usenet posts while inebriated.

:)

Cheers,
Rob
 
B

Bart Lateur

Gunnar said:
You missed the /d modifier.

You missed the fact that \013 is in octal, not in hex.

And the OP may just have missed that hex "13" is not decimal 13, which
seems like a far more likely candidate to want to delete.
 
G

Gunnar Hjalmarsson

Bart said:
You missed the fact that \013 is in octal, not in hex.

Since you say that *I* missed, I have to ask: Is there a requirement to
cover the whole problem when you try to help here?

I didn't even consider the SEARCHLIST, but I know that you need the /d
modifier to erase characters with the tr() operator, and I chose to call
the OP:s attention to that. Shouldn't I have done so?
 
B

Bart Lateur

Gunnar said:
Since you say that *I* missed, I have to ask: Is there a requirement to
cover the whole problem when you try to help here?

Well, you suggested that

tr/\013//d

would solve his problem of deleting the character hex "13", which it
doesn't.

If you don't solve the whole problem, be prepared for corrections.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,202
Messages
2,571,057
Members
47,667
Latest member
DaniloB294

Latest Threads

Top