isalnum(), isalpha(), iscntrl(), isdigit(), isgraph(), islower(), isprint(), ispunct(), isspace(), isupper(), and isxdigit()

Syntax
  #include <ctype.h>

  
  int isalnum (int ch);

  
  int isalpha (int ch);

  
  ...

  
  int isxdigit(int ch);

  
Description

These functions determine whether character ch belongs to a certain set of characters. The following table describes the character ranges tested by the functions.

Table 1. Appropriate character range for the testing functions
Function Range Tested
isalnum() alphanumeric character, i.e., A-Z, a-z or 0-9.
isalpha() an alphabetic character, i.e., A-Z or a-z.
iscntrl() a control character, i.e., \000-\037 or \177 ( DEL).
isdigit() a decimal digit, i.e., 0-9.
isgraph() a printable character except space ( ! - or ~ ).
islower() a lower case letter, i.e., a-z.
isprint() a printable character ( ' '-'~').
ispunct() a punctuation character, i.e., '!'-'/', ':'-'@', '['-''' and '{'-'~'.
isspace() a white space character, i.e., ' ', '\f', '\n', '\r', '\t' and '\v'.
isupper() an upper case letter, i.e., A-Z.
isxdigit() a hexadecimal digit, i.e., 0-9, A-F or a-f.
Return

TRUE (i.e., 1), if ch is in the character class; zero otherwise.

See also

tolower() and

toupper()