iswalnum, iswalpha, iswcntrl, iswdigit, iswgraph, iswlower, iswprint, iswpunct, iswspace, iswupper, or iswxdigit Subroutine

Purpose

Tests a wide character for membership in a specific character class.

Library

Standard C Library (libc.a)

Syntax

#include <wchar.h>
int iswalnum (WC)
wint_t WC;
int iswalpha (WC)
wint_t WC;
int iswcntrl (WC)
wint_t WC;
int iswdigit (WC)
wint_t WC;
int iswgraph (WC)
wint_t WC;
int iswlower (WC)
wint_t WC;
int iswprint (WC)
wint_t WC;
int iswpunct (WC)
wint_t WC;
int iswspace (WC)
wint_t WC;
int iswupper (WC)
wint_t WC;
int iswxdigit (WC)
wint_t WC;

Description

The isw subroutines check the character class status of the wide character code specified by the WC parameter. Each subroutine tests to see if a wide character is part of a different character class. If the wide character is part of the character class, the isw subroutine returns true; otherwise, it returns false.

Each subroutine is named by adding the isw prefix to the name of the character class that the subroutine tests. For example, the iswalpha subroutine tests whether the wide character specified by the WC parameter is an alphabetic character. The character classes are defined as follows:

Item Description
alnum Alphanumeric character.
alpha Alphabetic character.
cntrl Control character. No characters in the alpha or print classes are included.
digit Numeric digit character.
graph Graphic character for printing, not including the space character or cntrl characters. Includes all characters in the digit and punct classes.
lower Lowercase character. No characters in cntrl, digit, punct, or space are included.
print Print character. All characters in the graph class are included, but no characters in cntrl are included.
punct Punctuation character. No characters in the alpha, digit, or cntrl classes, or the space character are included.
space Space characters.
upper Uppercase character.
xdigit Hexadecimal character.

Parameters

Item Description
WC Specifies a wide character for testing.

Return Values

If the wide character tested is part of the particular character class, the isw subroutine returns a nonzero value; otherwise it returns a value of 0.