StringIsSpace

首页  后退  前进

StringIsSpace
down2

StringIsSpace

检查字符串是否仅包含空白字符.

 

StringIsSpace ( "string" )

参数

string

目标字符串

返回值

成功:

返回 1.

失败:

返回 0, 字符串包含非空白符.

备注

空白符是指从 Chr(9) 到 Chr(13) 的所有字符, 包括水平制表符、换行符、垂直制表符、换页符以及回车符.

空白还包括空字符串 ( Chr(0) ) 和标准空格 ( Chr(32) ).

 

函数示例

#include <MsgBoxConstants.au3>
Local $sString = "   " & @CRLF & @CRLF & Chr(11) & @TAB & " " & @CRLF ; Check whether this string contains only whitespace characters.
If StringIsSpace($sString) Then
    MsgBox($MB_SYSTEMMODAL, "", "The variable contains only whitespace characters.")
Else
    MsgBox($MB_SYSTEMMODAL, "", "The variable does not contain whitespace characters.")
EndIf

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

 

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

参见:

StringStripWS, StringIsASCII, StringStripCR

例子
copy
StringIsSpace('~~~~'&@LF&Chr(11)&@TAB&'~~'&@CRLF
up2

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