Autor Beitrag
Gwaineg
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 55

WIN XP Prof
D7 Ent
BeitragVerfasst: Mo 22.08.05 16:23 
ich brauch eine funktion mit der ich alle : in einem string verdopple

hab es schon so probiert:
ausblenden Delphi-Quelltext
1:
2:
while pos(':',s)<>0 do
  insert(':',s,pos(':',s)


aber da kommt natürlich nur eine endlosschleife heraus
retnyg
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 2754

SNES, GB, GBA, CPC, A500, 486/66, P4/3.0HT: NintendOS, AmigaOS, DoS
Delphi 5, Delphi 7
BeitragVerfasst: Mo 22.08.05 16:30 
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
function convert(s:string):string;
var i,l,c : integer;
begin
   l:=length(s);
   c:=0;
   for i := 1 to l   do
     if s[i]=':' then inc(c);
   setlength(result,l+c*2);
   c:=0;
   for i := 1 to l do begin
     inc(c);
     result[c] := s[i];
     if s[i]=':' then begin
       inc(c);
       result[c]:=':';
     end;
   end;
end;

_________________
es gibt leute, die sind genetisch nicht zum programmieren geschaffen.
in der regel haben diese leute die regel...
Fabian W.
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 1766

Win 7
D7 PE
BeitragVerfasst: Mo 22.08.05 16:43 
ausblenden Delphi-Quelltext
1:
Richedit1.Text := StringRePlace(Richedit1.Text, ':', '::', [rfReplaceAll]);					
Gwaineg Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 55

WIN XP Prof
D7 Ent
BeitragVerfasst: Mo 22.08.05 18:02 
thx
wusste ich doch das es dafür eine eigene function gibt