#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int 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);
for(i = 0; i < sizeof(s); i++) //小写
s[i] = tolower(s[i]);
printf("after tolower() : %s\n", s);
system("pause");
return 0;
}
实例56 字符串大小写统一变换
最新推荐文章于 2022-05-04 12:55:53 发布