strlwr()函数是C语言中的内置函数,用于将给定的字符串转换为小写。
用法:
char *strlwr(char *str);
参数:
str:这表示要转换为小写字母的给定字符串。
返回值:它返回将给定字符串str的字符转换为小写字母后获得的修改后的字符串。
注意:这是一个非标准功能,仅适用于旧版本的MicrosoftC。
以下示例程序旨在说明C语言中的strlwr()函数:
示例1:
// C program to demonstrate
// example of strlwr() function
#include
#include
int main()
{
char str[ ] = "GEEKSFORGEEKS IS THE BEST";
// converting the given string into lowercase.
printf("%s\n",strlwr (str));
return 0;
}
输出:
geeksforgeeks is the best
示例2:
// C program to demonstrate
// example of strlwr() function.
#include
#include
int main()
{
char str[] = "CompuTer ScienCe PoRTAl fOr geeKS";
printf("Given string is:%s\n",str);
printf("\nString after converting to the "
"lowercase is:%s",strlwr(str));
return 0;
}
输出:
Given string is:CompuTer ScienCe PoRTAl fOr geeKS
String after converting to the lowercase is:computer science portal for geeks
2599

被折叠的 条评论
为什么被折叠?



