For example, I have a bit string as:
B'101000000000000000000010'
How do I count the number of ones in it? In this example, it is 3.
Thanks,Cheng