Forum

HomeHomeCoreCoreGeneralGeneralREPLACE and commasREPLACE and commas
Previous
 
Next
New Post
2/26/2015 8:17 AM
 

Hi All,

I'm having a problem with the REPLACE formatter and commas where the comma is in the variable I want to use in the replace

Example

[FORMAT,"Some ~BLAH~ text",{REPLACE,~BLAH~,[SomeVariable,Action]}]

Where SomeVariable,Action equals "This text contains a , comma" 

The comma in text in the action variable messes up the REPLACE 

Anyone have any ideas how to get round this without going through multiple steps.

Thanks in advance for any help given

Tony



New Post
2/27/2015 1:20 AM
 

Hi Tony,

have a look at these two threads:

http://openwebstudio.com/Community/Fo... and http://openwebstudio.com/Community/Fo...

hth

Barry

New Post
2/27/2015 2:48 AM
 

Hi Barry,

Thanks for those links. It was the second one that helped solve the problem.

The answer was to use COALESCE and wrap everything in quotes. The solution was

[COALESCE ,myVariable,Action,"{REPLACE:~BLAH~,\"[SomeVariable,Action]\"}"]

Thanks again

Tony

New Post
2/27/2015 12:10 PM
 

Glad that helped.  You should also get used to using a firewall character before the coalesce command, so that rogue stuff doesn't get through, often, the pipe | character is used in such a way that your example would become:

[|COALESCE ,myVariable,Action,"{REPLACE:~BLAH~,\"[SomeVariable,Action]\"}"]

There's more information here:

http://www.openwebstudio.com/Communit...

Previous
 
Next
HomeHomeCoreCoreGeneralGeneralREPLACE and commasREPLACE and commas


 

New York, NY • Baltimore, MD • Vienna, VA • St. Louis, MO • Seattle, WA • info@openwebstudio.com

Bookmark & Share Bookmark and Share