Name

iswspace

Synopsis

Ascertains whether a given wide character produces space

#include <wctype.h>
intiswspace( wint_t wc );

The iswspace() function is the wide-character version of the isspace() character classification function. It tests whether its wide character argument produces whitespace rather than a glyph when printed—that is, a space, tabulator, newline, or the like. If the argument is a whitespace wide character, iswspace() returns a nonzero value (that is, true); if not, the function returns 0 (false).

Which wide characters fall into the whitespace class depends on the current locale setting for the category LC_CTYPE, which you can query or change using the setlocale() function. In all locales, however, if iswspace() is true for a given wide character, then iswalnum(), iswgraph(), and iswpunct() are false.

Example

See the example for iswalpha() in this chapter.

See Also

iswblank(), iswprint(); the corresponding function for byte characters, isspace(); iswalnum(), iswalpha(), iswcntrl(), iswdigit(), iswgraph(), iswlower(), iswprint(), iswpunct(), iswupper(), iswxdigit(), setlocale(); the extensible wide-character classification function, iswctype()

Get C in a Nutshell now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.