Product SiteDocumentation Site

7.4.11. C2X (Character to Hexadecimal)


>>-C2X(string)-------------------------------------------------><

Returns a string, in character format, that represents string converted to hexadecimal. The returned string contains twice as many bytes as the input string. On an ASCII system, C2X(1) returns 31 because the ASCII representation of the character 1 is "31"X.
The string returned uses uppercase alphabetical characters for the values A-F and does not include whitespace characters. The string can be of any length. If string is null, a null string is returned.
Here are some examples:

Example 7.17. Builtin function C2X

C2X("0123"X)    ->    "0123"   /* "30313233"X     in ASCII */
C2X("ZD8")      ->    "5A4438" /* "354134343338"X in ASCII */