unit U_Capital;

interface

uses SysUtils;

function Capital(Frase : String) : String;

implementation

function  Capital(Frase : String) : String;
Var
   I : Integer;
   Final : String;
   Upper : Boolean;
begin
     {Função que retorna sentenças com "A Primeira Letra Maiúscula"}
     Upper := True;
     Frase := AnsiLowerCase(Frase);
     For I := 1 to Length(Frase) Do
     begin
          If Upper Then
          begin
             Final := Final + AnsiUpperCase(Frase[I]);
             Upper := False;
          end
          Else
              Final := Final + Frase[I];
          If Frase[I] = ' ' Then
             Upper := True;
     end;
     Capital := Final;
end;

end.
