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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Replace chr(13) & chr(10)

Status
Not open for further replies.

knuckle05

Programmer
Dec 17, 2001
247
CA
Hi All,

I have a text field which contains CR and Line Feeds.

I would like to replace these with a [space].

I've done a lot of searching however nothing seems to work.
I'm using Crystal 7, and there does not seem to be a REPLACE function.

Anyone know of any other ways?
 
Hi,
Crystal 8.0 has the replace function I am not sure if you the replace function in crystal 7.0. Go to the help and see how the replace function is used. I have use replace function in crystal 8.


Thanks,
Hamida
 
Does this:

"I have a text field which contains CR and Line Feeds."

Mean that you have a single carriage return and multiple line feeds within the field?

I'll assume that you have a carriage retrun+line feed somewhere in the string, and not just at the end:

whileprintingrecords;
numbervar x;
stringvar NewString :="";

for x:= 1 to length(trim({Nukeme.testtext})) do(
if mid({Nukeme.testtext},x,1) <> chr(13) and
mid({Nukeme.testtext},x,1) <> chr(10) then
NewString := NewString + mid({Nukeme.testtext},x,1)
);
NewString

They should be gone.

-k kai@informeddatadecisions.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top