test for any lowercase letter
#include <ctype.h> int islower( int c );
The islower() function tests for any lowercase letter 'a' through 'z'.
A nonzero value when argument is a lowercase letter, otherwise zero.
#include <stdio.h>
#include <ctype.h>
char chars[] = {'A', 'a', 'z', 'Z'};
#define SIZE sizeof( chars ) / sizeof( char )
void main()
{
int i;
for( i = 0; i < SIZE; i++ ) {
printf( "Char %c is %sa lowercase character\n",
chars[i],
( islower( chars[i] ) ) ? "" : "not " );
}
}
produces the output
Char A is not a lowercase character Char a is a lowercase character Char z is a lowercase character Char Z is not a lowercase character
ANSI
| Safety: | |
|---|---|
| Interrupt handler | Yes |
| Signal handler | Yes |
| Thread | Yes |
isalnum(), isalpha(), iscntrl(), isdigit(), isgraph(), isprint(), ispunct(), isspace(), isupper(), isxdigit(), tolower(), toupper()