Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

stripping cr and lf from delphi strings

Status
Not open for further replies.

delfy

MIS
Feb 8, 2005
96
JM
i tried doing this but it doesn't work

AnsiReplaceText(MyString, #13, ' ');

neither does this

AnsiReplaceText(MyString, #13#10, ' ');

or this

AnsiReplaceText(MyString, #10, ' ');

anyone ideas anyone Please

 

Something like this should do it:
Code:
sNew := StringReplace(sOld,#13#10,' ',[rfReplaceAll]);
 
Try Trim(string);


Steve: Delphi a feersum engin indeed.
 
Trim(string) is a good one assuming the control characters are never in the middle of a string.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top