isalnum
来源:互联网 发布:手机淘宝在哪里看积分 编辑:程序博客网 时间:2024/05/16 08:24
头文件:#include <ctype.h>
isalnum() 用来判断一个字符是否为英文字母或数字,相当于 isalpha(c) || isdigit(c),其原型为:
int isalnum(int c);
【参数】c 为需要检测的字符。
【返回值】若参数c 为字母或数字,若 c 为 0 ~ 9 a ~ z A ~ Z 则返回非 0,否则返回 0。
注意,isalnum()为宏定义,非真正函数。
【实例】找出str 字符串中为英文字母或数字的字符。输出结果:
1 is an apphabetic character
2 is an apphabetic character
3 is an apphabetic character
c is an apphabetic character
F is an apphabetic character
D is an apphabetic character
s is an apphabetic character
P is an apphabetic character
e is an apphabetic character
isalnum() 用来判断一个字符是否为英文字母或数字,相当于 isalpha(c) || isdigit(c),其原型为:
int isalnum(int c);
【参数】c 为需要检测的字符。
【返回值】若参数c 为字母或数字,若 c 为 0 ~ 9 a ~ z A ~ Z 则返回非 0,否则返回 0。
注意,isalnum()为宏定义,非真正函数。
【实例】找出str 字符串中为英文字母或数字的字符。
- #include <ctype.h>
- main(){
- char str[] = "123c@#FDsP[e?";
- int i;
- for (i = 0; str[i] != 0; i++)
- if(isalnum(str[i]))
- printf("%c is an alphanumeric character\n", str[i]);
- }
#include <ctype.h>main(){ char str[] = "123c@#FDsP[e?"; int i; for (i = 0; str[i] != 0; i++) if(isalnum(str[i])) printf("%c is an alphanumeric character\n", str[i]);}
1 is an apphabetic character
2 is an apphabetic character
3 is an apphabetic character
c is an apphabetic character
F is an apphabetic character
D is an apphabetic character
s is an apphabetic character
P is an apphabetic character
e is an apphabetic character
0 0
- isalnum
- isalnum
- isalnum
- isalnum
- isalnum() 函数
- isalnum <ctype.h> <cctype>
- isalnum的使用
- isalnum()和isalpha()
- isalnum ( )【C语言库函数源代码】
- ctype库中的函数isalnum
- [C-Library]ctype.h - isalnum()
- isalnum字符串测试函数应用实例
- isalnum,isalpha,isdigit.....isxdigit,ispunt等字符函数的检测程序
- C语言isalnum()函数:判断字符是否为英文字母或数字
- C语言字符检测函数:isalnum、isalpha、isascii、iscntrl、isdigit、isgraph、islower、isspace、ispunct、isupper
- 【C++】isalpha、islower、isupper、isalnum、isblank、isspace函数<cctype>头文件
- C语言isalnum()函数:判断字符是否为英文字母或数字
- “adb.exe已停止工作”的解决方案(参考)
- isascii
- android广播大全
- log4j 根据日期来生成日志文件
- isalpha
- isalnum
- CI框架源码阅读笔记7 配置管理组件 Config.php
- 用private和public封装函数
- android studio 在线更新android sdk,遇到无法Fetching https://dl-ssl.google.com/...的解决方案
- 安装Chromium浏览器并添加Flash插件Pepper Flash Player
- 为什么调用 FragmentPagerAdapter.notifyDataSetChanged() 并不能更新其 Fragment?
- Linux下实现秒级定时任务的两种方案(crontab 每秒运行)
- 我的第一个OC语言程序
- java list add addall