Programmation en caml

ramzi986 Messages postés 17 Statut Membre -  
KX Messages postés 19031 Statut Modérateur -
voila mon probleme est ke je voudrais créer une fonction ki me dit si le caractere entré est une lettre ou un chiffre.. quelqu'un pourrai m'aider. merci

1 réponse

KX Messages postés 19031 Statut Modérateur 3 020
 
let analyse c=
match int_of_char c with
	|i when i>=97 && i<=122 -> "Lettre minuscule"
	|i when i>=65 && i<=90 -> "Lettre majuscule"
	|i when i>=48 && i<=57 -> "Chiffre"
	|_-> "Caractère spécial";;
0