ctype
The ctype library has functions to check if a character is part of a specific category of ASCII characters.
Functions
std::ctype::isdigit
std::ctype::isdigitChecks if the given character c is a digit between '0' and '9'
c: The character to checkreturn: True ifcis part of this range, false otherwise
fn isdigit(char c);std::ctype::isxdigit
std::ctype::isxdigitChecks if the given character c is a hexadecimal digit between '0' and '9', A and F or a and f
c: The character to checkreturn: True ifcis part of this range, false otherwise
fn isxdigit(char c);std::ctype::isupper
std::ctype::isupperChecks if the given character c is a upper case letter between 'A' and 'Z'
c: The character to checkreturn: True ifcis part of this range, false otherwise
fn isupper(char c);std::ctype::islower
std::ctype::islowerChecks if the given character c is a lower case letter between 'a' and 'z'
c: The character to checkreturn: True ifcis part of this range, false otherwise
fn islower(char c);std::ctype::isalpha
std::ctype::isalphaChecks if the given character c is either a upper or lower case letter between 'A' and 'Z' or 'a' and 'z'
c: The character to checkreturn: True ifcis part of this range, false otherwise
fn isalpha(char c);std::ctype::isalnum
std::ctype::isalnumChecks if the given character c is a upper or lower case letter or a number
c: The character to checkreturn: True ifcis part of this range, false otherwise
fn isalnum(char c);std::ctype::isspace
std::ctype::isspaceChecks if the given character c is a space character
c: The character to checkreturn: True ifcis part of this range, false otherwise
fn isspace(char c);std::ctype::isblank
std::ctype::isblankChecks if the given character c is a invisible character
c: The character to checkreturn: True ifcis part of this range, false otherwise
fn isblank(char c);std::ctype::isprint
std::ctype::isprintChecks if the given character c has a printable glyph
c: The character to checkreturn: True ifcis part of this range, false otherwise
fn isprint(char c);std::ctype::iscntrl
std::ctype::iscntrlChecks if the given character c is a control code
c: The character to checkreturn: True ifcis part of this range, false otherwise
fn iscntrl(char c);std::ctype::isgraph
std::ctype::isgraphChecks if the given character c has a visible glyph
c: The character to checkreturn: True ifcis part of this range, false otherwise
fn isgraph(char c);std::ctype::ispunct
std::ctype::ispunctChecks if the given character c is a punctuation character
c: The character to checkreturn: True ifcis part of this range, false otherwise
fn ispunct(char c);Last updated
Was this helpful?