procedure TForm1.Button1Click(Sender: TObject);
Var
sTrim, sMay, sMin, sDigit : String;
nLongi, wNum, nResto, nMay, nMin, nDigit: Word;
begin
wNum:=0; nMay:=0; nMin:=0; nDigit:=0; nResto:=0;
sMay:=''; sMin:=''; sDigit:= '';
sTrim:=TRIM(Memo1.Text);
nLongi:=Length(sTrim);
for wNum := 1 to Length(sTrim) do
case Memo1.Text[wNum] of
'0'..'9': nDigit := nDigit +1;
'A'..'Z','Ñ', 'Á','É', 'Í', 'Ó','Ú','Ü': nMay:= nMay+1;
'a'..'z','ñ','á','é','í','ó','ú','ü': nMin:=nMin +1;
else
nResto:=nResto +1
end;
sMay:= IntToStr(nMay);
sMin:= intToStr(nMin);
sDigit:= IntToStr(nDigit);
ShowMessage(' Longitud String: ' + IntToStr(nLongi)+#13 +'MAYÚSCULAS hay : ' + sMay + #13
+'minúsculas hay : ' + sMin + #13
+' y dígitos hay : ' + sDigit + #13
+'El resto: ' + IntToStr(nResto ));
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
Memo1.Lines[0]:='';
end;