Product Site

5.1.7.104. x2b

Returns a string, in character format, that represents the receiving string, which is a string of hexadecimal characters converted to binary. The receiving string can be of any length. Each hexadecimal character is converted to a string of 4 binary digits. The receiving string can optionally include whitespace characters (at byte boundaries only, not leading or trailing) to improve readability; they are ignored.

The returned string has a length that is a multiple of four, and does not include any whitespace.

If the receiving string is null, the method returns a null string.
Example 5.139. String class — x2b method
"C3"~x2b        -->  "11000011"
"7"~x2b         -->  "0111"
"1 C1"~x2b      -->  "000111000001"

You can combine x2b with the methods d2x and c2x to convert numbers or character strings into binary form.
Example 5.140. String class — x2b method with c2x
"C3"x~c2x~x2b  -->  "11000011"
"129"~d2x~x2b  -->  "10000001"
"12"~d2x~x2b   -->  "1100"