C++_C语言中对字母进行大小写转换的简单方法,C语言tolower()函数:将大写字母
执行结果:
返回值:返回转换后的小写字母,若不须转换则将参数c 值返回。
before toupper() : aBcDeFgH12345;!#$ after toupper() : ABCDEFGH12345;!#$
范例:将s 字符串内的大写字母转换成小写字母。
函数说明:若参数 c 为大写字母则将该对应的小写字母返回。
头文件:
头文件:
#include <ctype.h> main(){ char s[] = "aBcDeFgH12345;!#$"; int i; printf("before tolower() : %s\n", s); for(i = 0; i < sizeof(s); i++) s[i] = tolower(s[i]); printf("after tolower() : %s\n", s); }
范例:将s 字符串内的小写字母转换成大写字母。
执行结果:
函数说明:若参数 c 为小写字母则将该对应的大写字母返回。
int toupper(int c);
#include <ctype.h> main(){ char s[] = "aBcDeFgH12345;!#$"; int i; printf("before toupper() : %s\n", s); for(i = 0; i < sizeof(s); i++) s[i] = toupper(s[i]); printf("after toupper() : %s\n", s); }
before tolower() : aBcDeFgH12345;!#$ after tolower() : abcdefgh12345;!#$
int tolower(int c);
返回值:返回转换后的大写字母,若不须转换则将参数c 值返回。
定义函数:
定义函数:
C语言tolower()函数:将大写字母转换为小写字母
#include <ctype.h>
#include <stdlib.h>
本站内容来源于网络,如有侵权请与我们联系,我们会及时删除,我们深感抱歉!
注:本站所有信息仅供用于网络技术学习参考,学习中请遵循相关法律法规!
本文地址: https://v30.fanwenzhu.com/jiaob/cjj/5930.shtml
相关文章
热门TAG
win10 ecshop 主机 阿里云 解决 配置 C# C++ 解析 SQL语句 命令 Go语言 方法 CSS3 HTML5 CSS win7 MSSQL 服务器配置 IIS7.5 IIS7 IIS6 IIS CentOS 7 Linux oracle数据库 oracle phpcms discuz discuz教程最新文章
-
只需要在调用Ctrl+B编译后
时间:2021-01-13
-
OpenGL超级宝典visual studio
时间:2021-01-04
-
Directx11 教程(2) 基本的wi
时间:2021-01-04
-
LeetCode11ContainerWithMostWate
时间:2021-01-04
-
C语言简单IT之家速成
时间:2020-12-27
-
三分钟了解Activity工作流
时间:2020-12-27
-
编译器是如何实现32位整型
时间:2020-12-27
-
C++中lower_bound函数和upper
时间:2020-12-27
热门文章
-
LeetCode11ContainerWithMostWater(最大水容器)
时间:2021-01-04
-
C语言简单编程速成
时间:2020-12-23
-
都2020了,这五个最佳C++的IDE你还没用过?
时间:2020-12-23
-
C语言源程序文件的后缀是什么?
时间:2020-12-23
-
OpenGL超级宝典visual studio 2013开发环境配置
时间:2021-01-04
-
编译器是如何实现32位整型的常量整数除
时间:2020-12-27
-
libusbwin32学习笔记(二)
时间:2020-12-27
-
C语言简单IT之家速成
时间:2020-12-27
-
C语言和Python语言有什么区别呢?
时间:2020-12-24
-
C++对象模型之RTTI的实现原理
时间:2020-12-23
