Function Reference


StringIsASCII

Checks if a string contains only ASCII characters in the range 0x00 - 0x7f (0 - 127).

StringIsASCII ( "string" )

Parameters

string The string to check

Return Value

Success: 1.
Failure: 0 if string contains extended ASCII characters.

Related

StringIsAlNum, StringIsAlpha, 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 ASCII characters.
If StringIsASCII($sString) Then
        MsgBox($MB_SYSTEMMODAL, "", "The variable contains ASCII characters.")
Else
        MsgBox($MB_SYSTEMMODAL, "", "The variable does not contain ASCII characters.")
EndIf