原型:extern int islower(int c); 用法:#include 功能:判断字符c是否为小写英文字母 说明:当c为小写英文字母(a-z)时,返回非零值,否则返回零。 举例: // islower.c #include #include main() { int c; clrscr(); // clear screen c='a'; printf("%c:%s/n",c,islower(c)?"yes":"no"); c='A'; printf("%c:%s/n",c,islower(c)?"yes":"no"); c='7'; printf("%c:%s/n",c,islower(c)?"yes":"no"); getchar(); return 0; }
-----------
Example
/* islower example */ #include #include int main () { int i=0; char str[]="Test String./n"; char c; while (str[i]) { c=str[i]; if (islower(c)) c=toupper(c); putchar (c); i++; } return 0; }
Output:
TEST STRING.