Checks if a string contains only alphanumeric characters.
StringIsAlNum ( "string" )
string | The string to check |
Success: | 1. |
Failure: | 0 if string contains non-alphanumeric characters. |
Keep in mind that any whitespace will cause StringIsAlNum() to return 0.
StringIsAlpha, StringIsASCII, StringIsDigit, StringIsLower, StringIsSpace, StringIsUpper, StringIsXDigit, StringLower, StringUpper
#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