Первая буква каждого слова в верхнем регистре
function LowCase(ch: CHAR): CHAR;
begin
case ch of
'A'..'Z': LowCase := CHR(ORD(ch) + 31);
else
LowCase := ch;
end;
end;
function proper(s: string): string;
var
t: string;
i: integer;
newWord: boolean;
begin
if s = '' then
exit;
s := lowercase(s);
t := uppercase(s);
newWord := true;
for i := 1 to length(s) do
begin
if newWord and (s[i] in ['a'..'z']) then
begin
s[i] := t[i];
newWord := false;
continue;
end;
if s[i] in ['a'..'z', ''''] then
continue;
newWord := true;
end;
result := s;
end; |