字符函数库 cctype
来源:互联网 发布:js如何实现弹窗 编辑:程序博客网 时间:2024/06/10 15:39
<cctype> (ctype.h)
Character handling functionsThis header declares a set of functions to classify and transform individual characters.
Functions
These functions take the int equivalent of one character as parameter 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 0represents true.
There are two sets of functions:
Character classification functions
They check whether the character passed as parameter belongs to a certain category:
- isalnum
- Check if character is alphanumeric (function )
- isalpha
- Check if character is alphabetic (function )
- isblank
- Check if character is blank (function )
- iscntrl
- Check if character is a control character (function )
- isdigit
- Check if character is decimal digit (function )
- isgraph
- Check if character has graphical representation (function )
- islower
- Check if character is lowercase letter (function )
- isprint
- Check if character is printable (function )
- ispunct
- Check if character is a punctuation character (function )
- isspace
- Check if character is a white-space (function )
- isupper
- Check if character is uppercase letter (function )
- isxdigit
- Check if character is hexadecimal digit (function )
Character conversion functions
Two functions that convert between letter cases:
- tolower
- Convert uppercase letter to lowercase (function )
- toupper
- Convert 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)
ASCII values characters iscntrl isblank isspace isupper islower isalpha isdigit isxdigit isalnum ispunct isgraph isprint 0x00 .. 0x08NUL, (other control codes)x 0x09tab ('\t')xxx 0x0A .. 0x0D(white-space control codes:'\f','\v','\n','\r')x x 0x0E .. 0x1F(other control codes)x 0x20space (' ') xx x0x21 .. 0x2F!"#$%&'()*+,-./ xxx0x30 .. 0x390123456789 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)x
The 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.
0 0
- C++ 字符函数库cctype
- cctype字符函数库使用
- 字符函数库cctype
- c++字符函数库 cctype
- 字符函数库 cctype
- C++ 字符函数库cctype
- 字符函数库cctype
- (八十四)字符函数库cctype
- C/C++字符函数库cctype
- 实用字符处理函数库:cctype(ctype.h)
- c++字符函数库cctype使用练习
- 【C++学习笔记】字符函数库cctype
- 【C++】学习笔记二十三——字符函数库cctype
- [C++ Primer Plus]学习笔记 --字符函数库cctype
- cctype中的字符函数
- cctype字符函数
- c++字符处理 cctype
- <cctype> C字符函数
- Android 5.0一些变化
- GreenDao讲义4:带你总览Feature
- Juce源码分析(一)Juce的优势
- iOS开发者一些有用的技术博客、设计文章、网站
- Leetcode: ZigZag Conversion
- 字符函数库 cctype
- 设计模式——装饰模式(Decorator Pattern)
- HashMap二三事
- VS2013 Windows7(X64被测试)安装方法 离线安装
- 用 Tomcat 和 Eclipse 开发 Web 应用程序
- 程序员博客参考
- 获取bcd码的长度
- 深入解析Ajax($.post和$.get的主要区别)——系列(二)
- Apache中httpd.conf文件的详解