Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re: How do I remove trailing zeros from a hex string?

by twerq (Deacon)
on Apr 11, 2001 at 22:48 UTC ( [id://71806]=note: print w/replies, xml ) Need Help??


in reply to How do I remove trailing zeros from a hex string?

A RegExp should be fine, depending on how many times you have to do this. I'm not sure if \0 will match your zeros, but give an expression like this a try:
s/\0+$//;
which will nuke all zeros at the end of a string

twerq update -- looks like someone beat me to the punch :)

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://71806]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others chilling in the Monastery: (5)
As of 2024-06-19 12:57 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?
    erzuuli‥ 🛈The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.