StringIsASCII

首页  后退  前进

StringIsASCII
down2

StringIsASCII

检查字符串是否包含 0x00 到 0x7f (0-127)之间的 ASCII 字符.

 

StringIsASCII ( "string" )

参数

string

目标字符串

返回值

成功:

返回 1.

失败:

返回 0, 字符串含有扩展 ASCII 字符.

 

函数示例

#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

----------------------------------------

该函数可以通过命令 exect 调用

参见:

StringIsAlNum, StringIsAlpha, StringIsDigit, StringIsSpace, StringIsLower, StringIsUpper, StringIsXDigit

例子
copy

exect=StringIsASCII('This~~is~~a~~sentence.') GLOBALEXECT<a> ;; 在0x00  -  0x7f(0  -  127)范围内检查只有ASCII符号的字符串中的存在

up2


tcimage © Аверин Андрей для Total Commander Image Averin-And@yandex.ru