Ver Mensaje Individual
  #4  
Antiguo 06-05-2008
Avatar de cHackAll
[cHackAll] cHackAll is offline
Baneado?
 
Registrado: oct 2006
Posts: 2.159
Reputación: 20
cHackAll Va por buen camino
Estas subastas de código son fantásticas, yo pongo el mío;

Código Delphi [-]
function Capitalize(Str: string): string;
var Index: Cardinal;
begin
 for Index := 1 to Length(Str) do
  if (Index = 1) or (Str[Index - 1] = ' ') then
   if Str[Index] in ['a'..'z'] then
    Dec(Str[Index], 32) else // verdad que parecería que sobra ese "else" ?
  else
   if Str[Index] in ['A'..'Z'] then
    Inc(Str[Index], 32);
 Result := Str;
end;
Responder Con Cita