Autor Beitrag
Danny87
ontopic starontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic star
Beiträge: 688

Windows 10 Pro 64bit
Sprachen: HTML, PHP, JavaScript, Delphi || IDE: RAD Studio 10.1 Berlin Starter, WeBuilder
BeitragVerfasst: Sa 08.12.07 05:25 
Guten Morgen liebe Leutz *g*

ich arbeite zur Zeit an einem Kontaktmanager (bin im Network tätig).
Nun habe ich folgendes Problem:
Um einen Text zu "entschärfen" möchte ich alle [RETURN]s durch den String '#new051line#' ersetzen.
Allerdings finde ich das Ende der Zeile nicht :(
Folgendes habe ich bereits probiert (rf enthält rfReplaceAll):
ausblenden Delphi-Quelltext
1:
StringReplace(sText,#10,'#new051line#',rf);					

ausblenden Delphi-Quelltext
1:
StringReplace(sText,#13,'#new051line#',rf);					

ausblenden Delphi-Quelltext
1:
StringReplace(sText,#10#13,'#new051line#',rf);					

ausblenden Delphi-Quelltext
1:
StringReplace(sText,#13#10,'#new051line#',rf);					

ausblenden Delphi-Quelltext
1:
StringReplace(sText,'\n','#new051line#',rf);					

Alles ohne Erfolg (nicht lachen bitte^^ hab schon länger nix richtiges mehr programmiert ;) )
Kann mir jemand nen Tipp geben (und tut dies auch) ? *g*


//EDIT: Achja...sText ist ein Text aus einer TMemo-Komponente (memNotizen.Text).



Liebe Grüße
Daniel
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 08.12.07 09:36 
Weist du den Rückgabewert der Funktion auch irgendeiner Varaible zu? So sollte das funktionieren:

ausblenden Delphi-Quelltext
1:
sText := StringReplace(sText,#13#10,'#new051line#',rf);					

_________________
We are, we were and will not be.
Danny87 Threadstarter
ontopic starontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic star
Beiträge: 688

Windows 10 Pro 64bit
Sprachen: HTML, PHP, JavaScript, Delphi || IDE: RAD Studio 10.1 Berlin Starter, WeBuilder
BeitragVerfasst: Sa 08.12.07 19:40 
Oh man, bin ich blöd^^ :oops:
Es stimmt also tatsächlich...wer im Zeitraum von 10 Wochen keine Anwendung entwickelt mutiert zum DAU :mrgreen:

Danke Gausi *g* :wink:
Atreyu
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 137


Delphi 7 Enterprise
BeitragVerfasst: So 09.12.07 19:00 
Jo, so ein ähnliches Problem hatte ich vor kurzem auch^^
Die ASCII Codes (10 und 13) für Return setzen sich ja aus Carriage Return und LineFeed (CRLF) zusammen (was genau was ist, weiss ich nicht) und daher...

Naja, nur so als Zusatzinfo =)