DB<45> p "NOPE! 1011111" =~ tr/01// 7 DB<46> p length "NOPE! 1011111" 13 DB<47>
> to count the number binary digits
Cheers Rolf
(addicted to the Perl Programming Language :)
Wikisyntax for the Monastery
In reply to Re^3: oneliner to count the number binary digits in this string 1011111
by LanX
in thread oneliner to count the number binary digits in this string 1011111
by suvendra123
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |