没有合适的资源?快使用搜索试试~ 我知道了~
首页使用C语言判断英文字符大小写的方法
C语言isupper()函数:判断字符是否为大写英文字母 头文件: #include <ctype> 定义函数: int isupper(int c); 函数说明:检查参数c是否为大写英文字母。 返回值:若参数c 为大写英文字母,则返回非 0,否则返回 0。 附加说明:此为宏定义,非真正函数。 范例:找出字符串str 中为大写英文字母的字符。 #include <ctype> main(){ char str[] = 123c@#FDsP[e?; int i; for(i = 0; str[i] != 0; i++) if(isupper(str[
资源详情
资源评论
资源推荐

使用使用C语言判断英文字符大小写的方法语言判断英文字符大小写的方法
C语言语言isupper()函数:判断字符是否为大写英文字母函数:判断字符是否为大写英文字母
头文件:
#include <ctype.h>
定义函数:
int isupper(int c);
函数说明:检查参数c是否为大写英文字母。
返回值:若参数c 为大写英文字母,则返回非 0,否则返回 0。
附加说明:此为宏定义,非真正函数。
范例:找出字符串str 中为大写英文字母的字符。
#include <ctype.h>
main(){
char str[] = "123c@#FDsP[e?";
int i;
for(i = 0; str[i] != 0; i++)
if(isupper(str[i]))
printf("%c is an uppercase character", str[i]);
}
执行结果:
F is an uppercase character
D is an uppercase character
P is an uppercase character
C语言语言islower()函数:判断字符是否为小写字母函数:判断字符是否为小写字母
头文件:
#include <ctype.h>
islower() 用来判断一个字符是否是小写字母,其原型为:
int islower(int c);
【参数】c 为需要检测的字符。
【返回值】若参数c 为小写英文字母,则返回非 0 值,否则返回 0。
注意,此为宏定义,非真正函数。
【实例】判断str 字符串中哪些为小写字母。
#include <ctype.h>
main(){
char str[] = "123@#FDsP[e?";
int i;
for(i = 0; str[i] != 0; i++)
if(islower(str[i]))
printf("%c is a lower-case character", str[i]);
}
输出结果:
c is a lower-case character
s is a lower-case character
e is a lower-case character
您可能感兴趣的文章您可能感兴趣的文章:C++统计中英文大小写字母、数字、空格及其他字符个数的方法C语言中对字母进行大小写转换的简单方
法C语言实现字母大小写转换的方法C语言中利用封装好的函数实现英文字母的大小写转换C++实现高性能转换大小写算法示





















weixin_38702047
- 粉丝: 3
- 资源: 968
上传资源 快速赚钱
我的内容管理 收起
我的资源 快来上传第一个资源
我的收益
登录查看自己的收益我的积分 登录查看自己的积分
我的C币 登录后查看C币余额
我的收藏
我的下载
下载帮助

会员权益专享
安全验证
文档复制为VIP权益,开通VIP直接复制

评论0