cancel
Showing results for 
Search instead for 
Did you mean: 

replace formula: how to put several replacements in one formula

Former Member
0 Kudos
8,065

Hello, I have a Crystal report in which I need to apply replace formula to strings of text that have multiple values that need to be replaced. Example lets say the field name of my text sting is "textdata" and it contains this value: one,two,three-four&five. now, I want to replace any of these characters , - & with a blank space " ". so,the only way I could figure out how to do this was to make several formulas as follows:

formula 1: replace (textdata, ",", " ")

formula 2: replace (formula 1, "-", " ")

formula 3: replace (formula 2, "&", " ")

now formula 3 give me the final result I am looking for with all those items replaced.

Can anybody show me in detail how to accomplish this by just using one formula?

thank you in advance for any suggestions or help, it is much appreciated.

steve

View Entire Topic
Former Member
0 Kudos

Steve,

You can nest the REPLACE function...


REPLACE(REPLACE(REPLACE({TextData}, ",", " "), "-", " "), "&", " ")

HTH,

Jason