Function Reference


StringIsXDigit

Checks if a string contains only hexadecimal digit (0-9, A-F) characters.

StringIsXDigit ( "string" )

Parameters

string The string to check

Return Value

Success: 1.
Failure: 0 if string contains non-hexadecimal characters.

Remarks

Valid characters are 0123456789abcdefABCDEF.
Note that a string containing whitespace or the "0x" prefix will cause StringIsXDigit() to return 0.

Related

StringIsAlNum, StringIsAlpha, StringIsASCII, StringIsDigit, StringIsLower, StringIsSpace, StringIsUpper, StringLower, StringUpper

Example

#include <MsgBoxConstants.au3>

MsgBox($MB_SYSTEMMODAL, "", "Is the string 42 a hexadecimal digit: " & StringIsXDigit("42") & @CRLF & _ ; Returns 1, as the string contains only hexadecimal (0-9, A-F) characters.
        "Is the string 00 a hexadecimal digit: " & StringIsXDigit("00") & @CRLF & _ ; Returns 1, as the string contains only hexadecimal (0-9, A-F) characters.
        "Is the string 1.0 a hexadecimal digit: " & StringIsXDigit("1.0") & @CRLF & _ ; Returns 0, due to the decimal point.
        "Is the number 1.0 a hexadecimal digit: " & StringIsXDigit(1.0) & @CRLF & _ ; Returns 1, due to the number to string conversion.
        "Is the string 'A string' a hexadecimal digit: " & StringIsXDigit("A string.") & @CRLF) ; Returns 0, due to the string containing whitespace.