Function Reference


StringIsAlNum

Checks if a string contains only alphanumeric characters.

StringIsAlNum ( "string" )

Parameters

string The string to check

Return Value

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

Remarks

As in other StringIs...() the check is stop if a Chr(0) is encountered inside the string.
Internally the C function is used to speed up the processing.

Keep in mind that any whitespace will cause StringIsAlNum() to return 0.

Related

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

Example

#include <MsgBoxConstants.au3>

Local $sString = "This is a sentence with whitespace." ; Check whether this string contains only alphanumeric characters.
If StringIsAlNum($sString) Then
    MsgBox($MB_SYSTEMMODAL, "", "The variable contains only alphanumeric characters.")
Else
    MsgBox($MB_SYSTEMMODAL, "", "The variable does not contain alphanumeric characters.")
EndIf