Ver Mensaje Individual
  #3  
Antiguo 06-05-2008
Avatar de jhonny
jhonny jhonny is offline
Jhonny Suárez
 
Registrado: may 2003
Ubicación: Colombia
Posts: 7.058
Reputación: 30
jhonny Va camino a la famajhonny Va camino a la fama
Yo tampoco recuerdo una función que haga eso y también propongo una función, para el caso:

Código Delphi [-]
 
function Capitalize(S: String): String;
var
  ListaVar: TStringList;
  Cadena  : String;
  i:  Integer;
begin
  ListaVar      :=  TStringList.Create;
  Result     :=  '';
  try
    ExtractStrings([' '],[' '], PCHAR(S), ListaVar);
    for I := 0 to ListaVar.Count - 1 do
    begin
      Cadena      :=  ListaVar[i];
      Cadena      :=  LowerCase(Cadena);
      Cadena[1]   :=  UpCase(Cadena[1]);
      Result   :=  Result + Cadena  + ' ';
    end;
    SetLength(Result, Length(Result)-1);
  finally
    ListaVar.Free;
  end;
end;
__________________
Lecciones de mi Madre. Tema: modificación del comportamiento, "Pará de actuar como tu padre!"

http://www.purodelphi.com/
http://www.nosolodelphi.com/
Responder Con Cita