| xHarbour Reference Documentation > Function Reference |
![]() |
![]() |
![]() |
Checks if the first character of a string is a white-space character.
IsSpace( <cString> ) --> lIsWhiteSpaceChar
The function returns .T. (true) when the leftmost character of a string is a white-space character, otherwise .F. (false).
The function is used to check if a string begins with a white-space character. It returns .T. (true) when the first character is a white-space character, and .F. (false) when it begins with any other character.
| See also: | IsAlNum(), IsAlpha(), IsAscii(), IsCntrl(), IsDigit(), IsGraph(), IsLower(), IsPrint(), IsSpace(), IsUpper(), IsXDigit(), Lower(), Upper() |
| Category: | Character functions , xHarbour extensions |
| Source: | rtl\is.c |
| LIB: | xhb.lib |
| DLL: | xhbdll.dll |
// The example collects all white-space characters in a string
// and displays their ASCII values.
PROCEDURE Main
LOCAL i, aSpace := {}
FOR i := 0 TO 255
IF IsSpace( Chr(i) )
AAdd( aSpace, i )
ENDIF
NEXT
AEval( aSpace, {|n| QOut(n) } )
// result:
// 9 <-- Horizontal tab
// 10 <-- Line feed
// 11 <-- Vertical tab
// 12 <-- Form feed
// 13 <-- Carriage return
// 32 <-- Space
RETURN
http://www.xHarbour.com