Freigeben über


isspace, iswspace, _isspace_l, _iswspace_l

 Determines if a particular character represents a space character.

int isspace(
   int c 
);
int iswspace(
   wint_t c 
);
int _isspace_l(
   int c,
   _locale_t locale
);
int _iswspace_l(
   wint_t c,
   _locale_t locale
);

Parameters

  • c
    Integer to test.

  • locale
    Locale to use.

Return Value

Each of these routines returns nonzero if c is a particular representation of a space character. isspace returns a nonzero value if c is a white-space character (0x09 – 0x0D or 0x20). The result of the test condition for the isspacefunction depends on the LC_CTYPE category setting of the locale; see setlocale for more information. The versions of these functions without the _lsuffix use the current locale for any locale-dependent behavior; the versions with the _l suffix are identical except that they use the locale passed in instead. For more information, see Locale.

iswspace returns a nonzero value if c is a wide character that corresponds to a standard white-space character.

When used with a debug CRT library, isspace will display a CRT assert if passed a parameter that is not EOF or in the range of 0 through 0xFF. When used with a non-debug CRT library, isspace will use the parameter as an index into an array, with undefined results if the parameter is not EOF or in the range of 0 through 0xFF.

Generic-Text Routine Mappings

TCHAR.H routine

_UNICODE & _MBCS not defined

_MBCS defined

_UNICODE defined

_istspace

isspace

_ismbcspace

iswspace

Requirements

Routine

Required header

isspace

<ctype.h>

iswspace

<ctype.h> or <wchar.h>

_isspace_l

<ctype.h>

_iswspace_l

<ctype.h> or <wchar.h>

For additional compatibility information, see Compatibility in the Introduction.

.NET Framework Equivalent

System::Char::IsWhiteSpace

See Also

Concepts

Character Classification

Locale

is, isw Routines