Autor Beitrag
Fighter#1
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 787

Win XP, Ubuntu 8.04
Turbo Delphi 2006, Delphi 2005 Pe, Delphi 5 Pe, Netbeans 6.1, Eclipse, Microsoft VisualC#, Dev C++, PHP, HTML, CSS
BeitragVerfasst: Mo 17.04.06 10:26 
Hallo
Ich habe ein Problem, ich möchte aus meinem Memo alles was vor zwei Leerzeilen steht löschen.
Das sieht etwa so aus:
ausblenden Delphi-Quelltext
1:
2:
3:
myString:=Memo1.Lines.Text;
Delete(myString,1,Pos({hier die beiden Leerzeilen ich habs so probiert:}#13#13,myString));
Memo2.Lines.Text:=myString;

_________________
Wer andere beherrscht ist stark,
wer sich selbst beherrscht ist mächtig. Lao Tse
jakobwenzel
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1889
Erhaltene Danke: 1

XP home, ubuntu
BDS 2006 Prof
BeitragVerfasst: Mo 17.04.06 10:28 
Ich habs jetzt nich an Memo.Lines.Text ausprobiert, aber besteht ein Zeilenumbruch in Windows nicht aus #13#10?

_________________
I thought what I'd do was, I'd pretend I was one of those deaf-mutes.
Stego
ontopic starontopic starontopic starhalf ontopic starofftopic starofftopic starofftopic starofftopic star
Beiträge: 35

WIN XP
Delphi 2005 Archi.
BeitragVerfasst: Mo 17.04.06 11:55 
Moin,
wenn ich das richtig sehe ist #13#13 für 2 Leerzeilen ;-)

Sonst hättest wohl mit #13#10 recht, ich meine chr (10) kommt auch in Frage, wenn ich das nicht mit was anderem verwechsele ^^

Momentan würde mir folgende Lösung dazu einfallen:
ausblenden Delphi-Quelltext
1:
2:
3:
myString:=Memo1.Lines.Text;
Delete(myString,1,Pos('' + #13#10 + '' + #13#10 + '' + #13#10 + '',myString) + 1);
Memo2.Lines.Text:=myString;


Es muss bloss vor und nach den Leerzeilen noch etwas stehen, sonst funktioniert das nicht.

Aber vielleicht weiß ja noch jemand ne bessere Lösung ;-)
Gruß Stephan