169
Views
6
Comments
Regex_Replace want to replace with space " "

Hi,

I want to replace special character with space " ". I am using site property configurable for replacement of character.

it chage special character with double quotes " ". 

But when I try to hard code " " in Replace, it works fine. 

Is there a way to add space through site property?


2018-05-11 10-51-15
Tiago Reis

Hello.

Did you try to add just a space on the site property? Is that it?

Thanks


UserImage.jpg
retkasvb

Hi,
I guess this problem might be because of how Outsystems transfer data within site properties. You may try to use local variable and get some sync with site property.

2019-01-07 16-04-16
Siya
 
MVP

Could you please share the pattern , test value and expected result over here ?

2020-09-15 13-07-23
Kilian Hekhuis
 
MVP

Hi Lovish,

Did you debug to check what value the site property contains when the code is running?

That said, afaik in Oracle databases, a single space is used to denote "empty string". Are you using an Oracle database? If not, perhaps the Platform still interprets a single space as "empty".

As a workaround, you could either hardcode the space, or if you really need it variable, but can restrict yourself to ASCII, you could use an integer instead of a character, and use Chr() in the Replace.

2024-05-14 05-39-17
Jothikarthika - EONE



Add below script in client action 

// Example string containing special characters

const inputString = $parameters.inputstring;// Regular expression to match special characters

const specialCharRegex = /[!@#$%^&*()_+]/g;// Replace special characters with "Q"

const replacedString = inputString.replace(specialCharRegex, 

$parameters.Replacesymbol );

$parameters.Out1 = replacedString;


assign $parameters.Out1  value in site property







2025-06-01 02-51-51
YASH PAL

Hi @Lovish Goyal 

Just the replace() function available in the outsystems.

Replace(String value,Text you want to replace,text that will replace)

like ("outsyste","e","em") = outsystem

you can use the nested replace function like one replace function inside another function. that will solve your problem.

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.