LANÇAMENTO! Curso de Delphi 2009, clique aqui e confira!
Código
Nesta funçao, passa-se como parametro uma string e é retornado a string com a primeira letra de cada palavra em maíuscula. Dúvidas entre em contato pelo msn: h1b3rt0@hotmail.com
}
function PrimeiraLetraMaiscula(Str: string): string;
var
i: integer;
esp: boolean;
begin
str := LowerCase(Trim(str));
for i := 1 to Length(str) do
begin
if i = 1 then
str[i] := UpCase(str[i])
else
begin
if i <> Length(str) then
begin
esp := (str[i] = ' ');
if esp then
str[i+1] := UpCase(str[i+1]);
end;
end;
end;
Result := Str;
end;
Planeta Delphi - www.planetadelphi.com.br - Todos os direitos reservados | Copyright 2001-2009
LANÇAMENTO! Curso de Delphi 2009, clique aqui e confira!