Redaguoti

Bendrinti naudojant


Character classification

Each of these routines tests a specified single-byte character, wide character, or multibyte character for satisfaction of a condition. (By definition, the ASCII character set between 0 and 127 are a subset of all multibyte-character sets. For example, Japanese katakana includes both ASCII and non-ASCII characters.)

The test conditions are affected by the setting of the LC_CTYPE category setting of the locale. For more information, see setlocale. The versions of these functions without the _l suffix use the current locale for this locale-dependent behavior; the versions with the _l suffix are identical except that they use the locale parameter passed in instead.

Generally these routines execute faster than tests you might write and should be favored over. For example, the following code executes slower than a call to isalpha(c):

if ((c >= 'A') && (c <= 'Z')) || ((c >= 'a') && (c <= 'z'))
    return TRUE;

Character-classification routines

Routine Character test condition
isalnum, iswalnum, _isalnum_l, _iswalnum_l, _ismbcalnum, _ismbcalnum_l, _ismbcalpha, _ismbcalpha_l, _ismbcdigit, _ismbcdigit_l Alphanumeric
_ismbcalnum, _ismbcalnum_l, _ismbcalpha, _ismbcalpha_l, _ismbcdigit, _ismbcdigit_l Multibyte alphanumeric
isalpha, iswalpha, _isalpha_l, _iswalpha_l, _ismbcalnum, _ismbcalnum_l, _ismbcalpha, _ismbcalpha_l, _ismbcdigit, _ismbcdigit_l Alphabetic
isascii, __isascii, iswascii ASCII
isblank, iswblank, _isblank_l, _iswblank_l, _ismbcsblank, _ismbcsblank_l Blank (space or horizontal tab)
iscntrl, iswcntrl, _iscntrl_l, _iswcntrl_l Control
iscsym, iscsymf, __iscsym, __iswcsym, __iscsymf, __iswcsymf, _iscsym_l, _iswcsym_l, _iscsymf_l, _iswcsymf_l Letter, underscore, or digit
iscsym, iscsymf, __iscsym, __iswcsym, __iscsymf, __iswcsymf, _iscsym_l, _iswcsym_l, _iscsymf_l, _iswcsymf_l Letter or underscore
isdigit, iswdigit, _isdigit_l, _iswdigit_l, _ismbcalnum, _ismbcalnum_l, _ismbcalpha, _ismbcalpha_l, _ismbcdigit, _ismbcdigit_l Decimal digit
isgraph, iswgraph, _isgraph_l, _iswgraph_l, _ismbcgraph, _ismbcgraph_l, _ismbcprint, _ismbcprint_l, _ismbcpunct, _ismbcpunct_l, _ismbcblank, _ismbcblank_l, _ismbcspace, _ismbcspace_l Printable other than space
islower, iswlower, _islower_l, _iswlower_l, _ismbclower, _ismbclower_l, _ismbcupper, _ismbcupper_l Lowercase
_ismbchira, _ismbchira_l, _ismbckata, _ismbckata_l Hiragana
_ismbchira, _ismbchira_l, _ismbckata, _ismbckata_l Katakana
_ismbclegal, _ismbclegal_l, _ismbcsymbol, _ismbcsymbol_l Legal multibyte character
_ismbcl0, _ismbcl0_l, _ismbcl1, _ismbcl1_l, _ismbcl2, _ismbcl2_l Japan-level 0 multibyte character
_ismbcl0, _ismbcl0_l, _ismbcl1, _ismbcl1_l, _ismbcl2, _ismbcl2_l Japan-level 1 multibyte character
_ismbcl0, _ismbcl0_l, _ismbcl1, _ismbcl1_l, _ismbcl2, _ismbcl2_l Japan-level 2 multibyte character
_ismbclegal, _ismbclegal_l, _ismbcsymbol, _ismbcsymbol_l Non-alphanumeric multibyte character
isprint, iswprint, _isprint_l, _iswprint_l, _ismbcgraph, _ismbcgraph_l, _ismbcprint, _ismbcprint_l, _ismbcpunct, _ismbcpunct_l, _ismbcblank, _ismbcblank_l, _ismbcspace, _ismbcspace_l Printable
ispunct, iswpunct, _ispunct_l, _iswpunct_l, _ismbcgraph, _ismbcgraph_l, _ismbcprint, _ismbcprint_l, _ismbcpunct, _ismbcpunct_l, _ismbcblank, _ismbcblank_l, _ismbcspace, _ismbcspace_l Punctuation
isspace, iswspace, _isspace_l, _iswspace_l, _ismbcgraph, _ismbcgraph_l, _ismbcprint, _ismbcprint_l, _ismbcpunct, _ismbcpunct_l, _ismbcblank, _ismbcblank_l, _ismbcspace, _ismbcspace_l White-space
isupper, iswupper, _ismbclower, _ismbclower_l, _ismbcupper, _ismbcupper_l Uppercase
_isctype, iswctype, _isctype_l, _iswctype_l Property specified by desc argument
isxdigit, iswxdigit, _isxdigit_l, _iswxdigit_l Hexadecimal digit
_mbclen, mblen, _mblen_l Return length of valid multibyte character; result depends on LC_CTYPE category setting of current locale

See also

Universal C runtime routines by category