Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re: oneliner to count the number binary digits in this string 1011111

by BillKSmith (Monsignor)
on Mar 13, 2021 at 16:31 UTC ( [id://11129576]=note: print w/replies, xml ) Need Help??


in reply to oneliner to count the number binary digits in this string 1011111

If you know that the string contains only binary digits, use length('1011111'). Use LanX's method if you wish to ignore non-binary characters.
Bill
  • Comment on Re: oneliner to count the number binary digits in this string 1011111
  • Download Code

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others perusing the Monastery: (3)
As of 2024-04-20 00:40 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found