strlwr(string)
函数返回给定字符串的小写形式。下面我们来看一个strlwr()
函数的简单例子。文章源自菜鸟学院-https://www.cainiaoxueyuan.com/ymba/6445.html
使用示例文章源自菜鸟学院-https://www.cainiaoxueyuan.com/ymba/6445.html
创建一个源文件:string_strlwr.c,其代码如下所示 -文章源自菜鸟学院-https://www.cainiaoxueyuan.com/ymba/6445.html
#include<stdio.h>
void main() {
char str[20];
printf("Enter string: ");
gets(str);//reads string from console
printf("String is: %s", str);
printf("
Lower String is: %s", strlwr(str));
}
执行上面示例代码,得到以下结果 -文章源自菜鸟学院-https://www.cainiaoxueyuan.com/ymba/6445.html
Enter string: YiiBai.com
String is: YiiBai.com
Lower String is: yiibai.com
文章源自菜鸟学院-https://www.cainiaoxueyuan.com/ymba/6445.html