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 else
if Str[Index] in ['A'..'Z'] then
Inc(Str[Index], 32);
Result := Str;
end;