Product Site

5.1.7.32. c2x

Returns a string, in character format, that represents the receiving string converted to hexadecimal. The returned string contains twice as many bytes as the receiving string. On an ASCII system, sending a c2x message to the receiving string 1 returns 31 because "31"X is the ASCII representation of 1.

The returned string has uppercase alphabetic characters for the values A-F and does not include whitespace. The receiving string can be of any length. If the receiving string is null, c2x returns a null string.
Example 5.71. String class — c2x method
Say "0123"X~c2x    -->    "0123"   /* "30313233"X     in ASCII */
Say "ZD8"~c2x      -->    "5A4438" /* "354134343338"X in ASCII */