Print Page | Close Window

remove all chr(10) from all strings

Printed From: Crystal Reports Book
Category: Crystal Reports for Visual Studio 2005 and Newer
Forum Name: Writing Code
Forum Discription: .NET programming API, report integration
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=15008
Printed Date: 03 May 2024 at 2:21am


Topic: remove all chr(10) from all strings
Posted By: anditburns
Subject: remove all chr(10) from all strings
Date Posted: 22 Nov 2011 at 3:49pm

Hi all,

I am trying to right up some code for work and I am struggling.
 
Basially what I have is a field from a database called {PROBSUMMARYM2.BW_SERVICES_AFFECTED} this field is a memo field
Because this field is a memo field there is a strong chance that when i convert to string
ToText ({PROBSUMMARYM2.BW_SERVICES_AFFECTED})
there will be chr(10) (next line) characters present in the string.
 
what I would like to do is remove all occurances of the char(10) for each occurance.
 
to give you an example of a likely output we could have
Quantum
Swift
Eximbills
 
But I need make this Quantum/Swift/Eximbils.
 
Having said that there could be any number of different combinations of char(10) depending on what services are effected (could have up to 10+ new lines in the string or it could have none)
 
thanks for your time.



Replies:
Posted By: asam
Date Posted: 26 Dec 2011 at 10:41am
formula = replace(
     replace(  {PROBSUMMARYM2.BW_SERVICES_AFFECTED}} ,chr(13),"/"),
    chr(10),"/");



Print Page | Close Window