Function StringIsSpace

Function Reference


StringIsSpace

Checks if a string contains only whitespace characters.

StringIsSpace ( "string" )

Parameters

string The string to check

Return Value

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

Remarks

Whitespace includes Chr(9) thru Chr(13) which are HorizontalTab, LineFeed, VerticalTab, FormFeed, and CarriageReturn. Whitespace also includes the null string ( Chr(0) ) and the standard space ( Chr(32) ).

Related

StringIsAlNum, StringIsAlpha, StringIsASCII, StringIsDigit, StringIsLower, StringIsUpper, StringIsXDigit, StringLower, StringStripCR, StringStripWS, StringUpper

Example

#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