ach stümmt
OK, dann wenigstens DeddyH's Variante ohne Temp-Variable
Delphi-Quellcode:
procedure MoveChar(
var S:
string; Index1, Index2: Cardinal);
begin
if (Index1 > Length(S))
or (Index2 > Length(S))
then
Raise Exception.Create('
Fehler');
If Index2 > Index1
Then Inc(Index2);
Insert(S[Index1], S, Index2);
Delete(S,Index1, 1);
end;