Autor Beitrag
Hybrid
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 112

Win XP Pro
D7 Ent
BeitragVerfasst: Mo 15.12.03 22:36 
Ist jetzt warscheinlich ne blöde Frage, aber wie kann man den Inhalt eines Strings umdrehen?
z.B.:
Der String a hat den Wert abcd und soll dann den Wert dcba haben.
obbschtkuche
Gast
Erhaltene Danke: 1



BeitragVerfasst: Mo 15.12.03 22:40 
So gehts:

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
function umkehren(s: string): string;
var
 a,b: pchar;
begin
 a := pchar(s);
 setlength(result, length(s));
 b := pchar(result)+length(result)-1;
 while a^ <> #0 do
 begin
  b^ := a^;
  dec(b);
  inc(a);
 end;
end;
Hybrid Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 112

Win XP Pro
D7 Ent
BeitragVerfasst: Mo 15.12.03 23:00 
Danke! Klappt perfekt.