Registriert seit: 18. Aug 2004
Ort: Edewecht
712 Beiträge
Delphi 5 Professional
|
Re: String umwandeln
4. Mär 2005, 07:46
Delphi-Quellcode:
procedure TForm1.Button1Click(Sender: TObject);
var
S1, S2: String;
I: Integer;
begin
S1 := #1#10#5;
S2 := '';
for I := 1 to Length(S1) do
case S1[I] of
#1 : S2 := S2 + '0000';
#2 : S2 := S2 + '0001';
#3 : S2 := S2 + '0002';
#4 : S2 := S2 + '0003';
#5 : S2 := S2 + '0010';
#6 : S2 := S2 + '0011';
#7 : S2 := S2 + '0012';
#8 : S2 := S2 + '0013';
#9 : S2 := S2 + '0020';
#10: S2 := S2 + '0021';
end;
ShowMessage(S2);
end;
Ciao, Sprint.
"I don't know what I am doing, but I am sure I am having fun!"
|