Section courante

A propos

Section administrative du site

ISLOWER

Est-ce un minuscule ?
Langage C ctype.h

Syntaxe

int islower(int caractere);

Paramètres

Nom Description
caractere Ce paramètre permet d'indiquer le caractère à vérifier

Description

Cette fonction indique si le caractère est une lettre minuscule.

Remarques

Exemple

Voici un exemple permettant de vérifier si toute la chaine de caractères est en minuscule :

Essayer maintenant !
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. #include <ctype.h>
  4. #include <string.h>
  5.  
  6. int isalllower(const char * string) {
  7.  int I;
  8.  for(I = 0; I < strlen(string); I++) {
  9.   if(isalpha(string[I])) {
  10.    if(!islower(string[I])) return 0;
  11.   }
  12.  }
  13.  return 1;
  14. }
  15.  
  16. int main() {
  17.  printf("sylvain maltais=%i\n",isalllower("sylvain maltais"));
  18.  printf("Sylvain Maltais=%i\n",isalllower("Sylvain Maltais"));
  19.  printf("SYLVain MALTais=%i\n",isalllower("SYLVain MALTais"));
  20.  printf("SYLVAIN MALTAIS=%i\n",isalllower("SYLVAIN MALTAIS"));
  21.  return 0;
  22. }

on obtiendra le résultat suivant :

sylvain maltais=1
Sylvain Maltais=0
SYLVain MALTais=0
SYLVAIN MALTAIS=0

Voir également

Langage de programmation - C++ - Référence de procédures et fonctions - islower

Références

Langage C, Edition Micro-Application, Gehard Willms, 2001, ISBN: 2-7429-2008-0, page 732.
Borland C++ for Windows 4.0, Library Reference, Edition Borland, 1993, Part # BCP1240WW21772, page 152.

Dernière mise à jour : Mardi, le 28 juillet 2015