| xHarbour Reference Documentation > Function Reference |
![]() |
![]() |
![]() |
Converts a Hex encoded character string to an ASCII string.
HexToStr( <cHexString> ) --> cASCIIstring
The function returns the decoded Hex string as a character string in ASCII format.
HexToStr() converts a Hex formatted character string to a character string in ASCII format. It converts only characters in the range from "0-9" and "a-f" or "A-F". If <cHexString> contains any other character, the conversion is stopped. The reverse function is StrToHex().
| See also: | CStr(), HexToNum(), NumToHex(), StrToHex(), Transform() |
| Category: | Character functions , Conversion functions , xHarbour extensions |
| Source: | rtl\hbhex2n.c |
| LIB: | xhb.lib |
| DLL: | xhbdll.dll |
// The example demonstrates return values of HexToStr()
PROCEDURE Main
LOCAL cString1 := "48656C6C6F"
LOCAL cString2 := "576F726C64"
? HexToSTr( cString1 ) // result: Hello
? HexToSTr( cString2 ) // result: World
RETURN
http://www.xHarbour.com