BitCountString (String function)
Count number of on bits in a string (String class)
[Introduced in Model 204 7.5]
This function counts the number of on bits in a string.
%count = string:BitCountString
|%count||Set to the number of bits that were on in the method object string.|
|string||The string in which on bits are to be counted.|
- Since there are 8 bits in every byte of a string, the result of the BitCountString function will always be a number from 0 to the length of the method object string times 8.
The following example counts the number of on bits in the EBCDIC representation of the string "City of Brotherly Love" and assigns it to a variable:
%homMuchLove = "City of Brotherly Love":bitCountString