1. 概述
This header declares a set of functions to classify and transform individual characters.
2. 函数
2.1 Character classification functions
序号 | 标签 | 原型 | 说明 |
---|
1 | isalnum | int isalnum ( int c ); | 判断字符c是不是十进制数字或字母 |
2 | isalpha | int isalpha ( int c ); | 判断字符是否为字母 |
3 | iscntrol | int iscntrl ( int c ); | 判断是否是控制字符 |
4 | isblank(c++11) | int isblank ( int c ); | 判断是否为tab(‘\t’)或space(’ ‘)字符 |
5 | isdigit | int isdigit ( int c ); | Check if character is decimal digit |
6 | isgraph | int isgrapg ( int c ); | Checks whether c is a character with graphical representation.(除空格之外的所有打印字符) |
7 | islower | int islower ( int c ); | Checks whether c is a lowercase letter. |
8 | isupper | int isupper( int c ) | Checks whether c is a uppercase letter. |
9 | isprint | int isprint ( int c ); | Checks whether c is a printable character. |
10 | ispunct | int ispunct ( int c ); | Checks whether c is a punctuation(标点符号) character. |
11 | isspace | int isspace ( int c ); | Checks whether c is a white-space character.(包括空格’ ‘、换页’\f’、换行’\n’、回车’\r’、水平制表’\t’和垂直制表符’\v’) |
12 | isxdigit | int isxdigit ( int c ); | Check if character is hexadecimal(十六进制)digit |
2.2 Character conversion functions
序号 | 标签 | 原型 | 说明 |
---|
1 | tolower | int tolower ( int c ); | Convert uppercase letter to lowercase |
2 | toupper | int toupper ( int c ); | Convert lowercase letter to uppercase |
3. 参考文献
- http://www.cplusplus.com/reference/cctype/
- 《C标准库》,P.J. Plauger 著