| xHarbour Reference Documentation > Function Reference |
![]() |
![]() |
![]() |
Checks if the first character of a string is a hexadecimal digit.
IsXDigit( <cString> ) --> lIsHexDigit
The function returns .T. (true) when the leftmost character of a string is a hexadecimal digit, otherwise .F. (false).
The function is used to check if a string begins with a hexadecimal digit. It returns .T. (true) when the first character is a hexadecimal digit, and .F. (false) when it begins with any other character.
| See also: | IsAlNum(), IsAlpha(), IsAscii(), IsCntrl(), IsDigit(), IsGraph(), IsLower(), IsPrint(), IsSpace(), IsUpper(), Lower(), Upper() |
| Category: | Character functions , xHarbour extensions |
| Source: | rtl\is.c |
| LIB: | xhb.lib |
| DLL: | xhbdll.dll |
// The example collects all hexadecimal digits in a string
// and displays it.
PROCEDURE Main
LOCAL i, cHex := ""
FOR i := 0 TO 255
IF IsXDigit( Chr(i) )
cHex += Chr(i)
ENDIF
NEXT
? cHex // result: 0123456789ABCDEFabcdef
RETURN
http://www.xHarbour.com