Zitat:
function StripDoubleChars(const Source: string): string;
var
C: AnsiChar;
cSet: set of 'A'..'Z';
I: Integer;
begin
cSet := [];
Result := '';
for I := 1 to Length(Source) do begin
C := AnsiChar(UpCase(Source[I]));
if not (C in ['A'..'Z']) then Continue;
if not (C in cSet) then begin
Include(cSet, C);
Result := Result + Source[I];
end;
end;
end;
Brauche das ganze als Prozedur oder jemand müsste mir sagen, ob der Aufruf unten korrekt ist:
Code:
procedure TCaesar.SetPassword(ps2: string);
var
i: integer;
begin
ps:=ps2;
ps2:=UpperCase(ps2);
for i:=1 to length(ps2) do begin
case ps2[i] of
'A'..'Z': ps:=ps + ps2[i];
'Ä': ps:=ps + 'A';
'Ö': ps:=ps + 'O';
'Ü': ps:=ps + 'U';
'ß': ps:=ps + 'S';
end;
end;
ps:= stripdoublechars(ps) ;
end;