Replace occurrences of character in a string with another

In Customer Shipment Entry, the ship to is a single string delimited with a tilde. I am writing a BPM to email shipment notifications and am needing to replace that tilde with a carriage return chr(10). The string looks like this…

Any help would be greatly appreciated!

It looks lik your address string is in the format of a list.

You can split the list into an array as follows and then deal with each element array as an address line:

List AddressLines = ShipTo Addr.Split(new char[0]).ToList();

foreach (string AddressLine in AddressLines)

{ …


Kind Regards,

Steve Dakin

ERP Specialist

Is this ABL for E9??


Sorry didn’t notice you were on E9.
I have only used this c# functionalitly in E10 on a custom code element of a BPM workflow.

I have not worked on E9 so don’t know if its relevant.


Thanks anyways. Appreciate the attempt.


I believe you’ll find the answer here: on page 1076, the Replace function.

Mark W.


MArk is correct REPLACE() not SUBSTITUTE()

EDIT: Added link below

REPLACE ( string , “~” , Chr(10) )

Something like this? I haven’t touched ABL in a while…

Exactly what I have tried:
strShipTo = replace(ttShipHead.AddrList, ‘~’, chr(10))
but validating gives me this error:
More than 32000 characters in a single statement–use -inp parm.

I have NO-UNDO the strShipTo variable definition…

Ahhhh haha Got it! ~ is a special character in Progress ABL so I have to do this:

strShipTo = replace(ttShipHead.AddrList, ‘~~’, chr(10))

It works! Thanks all!


BTW - 9.05.702A Ran into this not working as it did in 605.
When attempting to execute the BAQ it throws ye olde:
Table: , Level:, Type: , RowID: , Text: Business Query Execution error. Please contact your System Administrator.
Replace(OrderHed.SalesRepList, '~~' , ', ')
stopped working, not sure why, maybe using the tilde as a break makes Progress think the query is being hacked or something… might be a setting or issue with OpenEdge, who knows.
What did work was using the ASCII value for the tilde, 126:
Replace(OrderHed.SalesRepList, CHR(126) , ', ' )

Just in case someone is still on 9 or on their way to 10 had to upgrade to 702A.