C++ 字符函数库cctype
来源:互联网 发布:双色球软件哪个好 编辑:程序博客网 时间:2024/05/15 23:46
cctype (ctype.h)
<C++ Primer 第四版> 3.2.4 节 string 对象中字符的处理
<C++ Primer Plus 第五版> 6.3 节 字符函数库 cctype(比前者多个isblank介绍, 比较详细)
header
Character handling functions
This header declares a set of functions to classify and transform individual characters.
All these functions take as parameter the int equivalent of one character and return an int, that can either be another character or a value representing a boolean value: an int value of 0 means false, and an int value different from 0 represents true.
There are two sets of functions:
First a set of classifying functions that check whether the character passed as parameter belongs to a certain category. These are:
All these functions take as parameter the int equivalent of one character and return an int, that can either be another character or a value representing a boolean value: an int value of 0 means false, and an int value different from 0 represents true.
There are two sets of functions:
First a set of classifying functions that check whether the character passed as parameter belongs to a certain category. These are:
函数名称
返回值
isalnum() 如果参数是字母数字, 即字母或数字, 该函数返回 true isalpha() 如果参数是字母, 该函数返回 true isblank() 如果参数是空格或水平制表符, 该函数返回 true iscntrl() 如果参数是控制字符, 该函数返回 true isdigit() 如果参数是数字 (0~9), 该函数返回 true isgraph() 如果参数是除空格之外的打印字符, 该函数返回 true isprint() 如果参数是打印字符 (包括空格), 该函数返回 true ispunct() 如果参数是标点符号, 该函数返回 true isspace() 如果参数是标准空白字符, 如空格、进纸、换行符、回车、水平制表符或垂直制表符, 该函数返回 true islower() 如果参数是小写字母, 该函数返回 true isupper() 如果参数是大写字母, 该函数返回 true isxidgit() 如果参数是十六进制的数字, 即 0~9, a~f 或 A~F, 该函数返回 true(C++ Primer Plus 第五版)
And secondly, two functions to convert between letter cases:
tolowerConvert uppercase letter to lowercase (function)
toupperConvert lowercase letter to uppercase (function)
For the first set, here is a map of how the original 127-character ASCII set is considered by each function (an x indicates that the function returns true on that character)
NUL, (other control
codes)
x 0x09 .. 0x0D(white-space control
codes:
'/t','/f','/v','/n','/r')
xx 0x0E .. 0x1F(other control codes)x 0x20space (' ') x x0x21 .. 0x2F!"#$%&'()*+,-./ xxx0x30 .. 0x3901234567890 xxx xx0x3a .. 0x40:;<=>?@ xxx0x41 .. 0x46ABCDEF x x xx xx0x47 .. 0x5AGHIJKLMNOPQRSTUVWXYZ x x x xx0x5B .. 0x60[/]^_` xxx0x61 .. 0x66abcdef xx xx xx0x67 .. 0x7Aghijklmnopqrstuvwxyz xx x xx0x7B .. 0x7E{|}~ xxx0x7F(DEL)xThe characters in the extended character set (above 0x7F) may belong to diverse categories depending on the locale and the platform. As a general rule, ispunct, isgraph and isprint return true on these for the standard C locale on most platforms supporting extended character sets.
http://www.cplusplus.com/reference/clibrary/cctype/
- C/C++字符函数库cctype
- C++ 字符函数库cctype
- cctype字符函数库使用
- 字符函数库cctype
- c++字符函数库 cctype
- 字符函数库 cctype
- C++ 字符函数库cctype
- 字符函数库cctype
- 【C++】学习笔记二十三——字符函数库cctype
- (八十四)字符函数库cctype
- <cctype> C字符函数
- 实用字符处理函数库:cctype(ctype.h)
- c++字符函数库cctype使用练习
- 【C++学习笔记】字符函数库cctype
- C++:cctype中的字符函数
- [C++ Primer Plus]学习笔记 --字符函数库cctype
- 【C/C++】cctype中的字符函数
- cctype中的字符函数
- 使用SNMP通过IP地址查找对应交换机端口
- VS调试快捷键
- JavaScript面向对象编程
- Android设计模式之Builder
- ubuntu的root默认密码问题
- C++ 字符函数库cctype
- Python概述
- java中字符串转换成时间格式总结
- 使用sys.SQL_Modules获取SQL Server数据库对象(存储过程,视图,函数)定义脚本
- JAVA
- JAVA
- Linux块设备驱动(1)---块驱动中相关的结构体及其操作
- TreeView点击右键,直接选中当前节点
- DLL里的Dialog.DoModal返回-1