function Crypt(const s: string): string;
var i: integer;
begin
result := s;
for i := 1 to length(s) do
case ord(s[i]) of
ord('A')..ord('M'),ord('a')..ord('m'): result[i] := chr(ord(s[i])+13);
ord('N')..ord('Z'),ord('n')..ord('z'): result[i] := chr(ord(s[i])-13);
ord('0')..ord('4'): result[i] := chr(ord(s[i])+5);
ord('5')..ord('9'): result[i] := chr(ord(s[i])-5);
end;
end;
Beispiel :
procedure TForm1.Button1Click(Sender: TObject);
begin
Memo1.Text := Crypt(Memo1.Text);
end;
Keine Kommentare:
Kommentar veröffentlichen