Autor Beitrag
D. Annies
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 1843

windows 7
D6 Enterprise, D7 Pers und TD 2006
BeitragVerfasst: Sa 22.01.05 23:00 
Hi, Delpher,

wie kann ich in einem (mehrzeiligen) Memo eine Zeichenkette, z.B. einen Namen finden
und ihn dann durch einen anderen ersetzen?

Danke für die Hilfe,
Detlef Annies
Gausi
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 8554
Erhaltene Danke: 481

Windows 7, Windows 10
D7 PE, Delphi XE3 Prof, Delphi 10.3 CE
BeitragVerfasst: Sa 22.01.05 23:10 
Entweder: jede einzelne Zeile durchsuchen mit
ausblenden Delphi-Quelltext
1:
2:
for i:=0 to memo1.lines.count-1 do
 if pos(substr,memo1.lines[i])>0 then showmessage('Gefunden');

Oder einfach den ganzen Text mit pos(SubStr,memo1.Text);
Zum Ersetzen dürfte StringReplace genau das richtige sein.

_________________
We are, we were and will not be.
D. Annies Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 1843

windows 7
D6 Enterprise, D7 Pers und TD 2006
BeitragVerfasst: Sa 22.01.05 23:46 
Hi, Gausi,

Echt cool, du hast es drauf!
Danke für den Tipp,
Detlef Annies
D. Annies Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 1843

windows 7
D6 Enterprise, D7 Pers und TD 2006
BeitragVerfasst: So 23.01.05 09:49 
Hi, Gausi (et aliter)

Da haben wir uns wohl leider etwas zu früh gefreut:

Obwohl ich mit einem TntStringgrid arbeite, wird bei dem von dir vorgeschlagenen
Code der Teilstring nicht ersetzt.

Anmerkung: es handelt sich um Unicode-Strings, was auch (in grüner Schrift) erkannt
wird, wenn ich den Memoeditor aufrufe.

Hast du (habt ihr) noch eine Idee?

Danke, Detlef Annies
Gausi
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 8554
Erhaltene Danke: 481

Windows 7, Windows 10
D7 PE, Delphi XE3 Prof, Delphi 10.3 CE
BeitragVerfasst: So 23.01.05 10:19 
Vielleicht hilft es, wenn man mit den Funktionen
ausblenden Delphi-Quelltext
1:
2:
3:
4:
Utf8ToAnsi;
Utf8ToUnicode;
UnicodeToUtf8;
AnsiToUtf;
etwas rumspielt. Ist aber absolut ins Blaue geraten.

_________________
We are, we were and will not be.
D. Annies Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 1843

windows 7
D6 Enterprise, D7 Pers und TD 2006
BeitragVerfasst: So 23.01.05 14:34 
Hi, Gausi,

hab nun rumgespielt, aber es geht nicht.
Gibt es widestringreplace oder so etwas?
Oder kann es mit delete - replace gehen??

Grüße von D. Annies
D. Annies Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 1843

windows 7
D6 Enterprise, D7 Pers und TD 2006
BeitragVerfasst: So 23.01.05 18:53 
Hi, Delpher,

habe nun schon ordentlich rumprobiert, aber noch keine Lösung in einfacher
Sichtweite ...

Wer hat noch Erfahrungen auf diesem Gebiet und kann helfen?

Viele Grüße, :?
D. Annies