Question
Sky Solutions LLC
US
Last activity: 21 May 2020 23:51 EDT
How do I replace all single quotation marks to empty string?
I am trying to replace all single quotation marks (') to just an empty string ("") or no value because it makes the values in the Case Manager Portal weird.
***Edited by Moderator Marissa to update Platform Capability tags****
-
Like (0)
-
Share this page Facebook Twitter LinkedIn Email Copying... Copied!
Updated: 14 Jun 2021 7:38 EDT
Pegasystems Inc.
IN
You can use the replaceAll function to achieve this. Please find the below screenshot for more details.
Sky Solutions LLC
US
I had put the expression into the Java source of this Function. Would this work?
Updated: 14 Jun 2021 7:38 EDT
Pegasystems Inc.
IN
This function you can refer it in the Data Transform or Activity etc, wherever required to change the property value.
pxreplaceAllViaRegex is an OOTB function and could you please say the need for changing there.
Sky Solutions LLC
US
I was able to come up with a perfectly working function which I have posted below.
Now the problem is, how do I make the function work on a clipboard property with a string value? On the picture below I want the expression to go through each resultSet to replace all single quotes in the errorDescription.
Updated: 14 Jun 2021 7:38 EDT
Pegasystems Inc.
IN
As resultset is a pagelist, you might need to loop through it an then use this function and mention .errorResult as property if you want to replace it.
Sky Solutions LLC
US
Or is there a way to make the HTML tags that are in the errorDescription appear as regular string? Because right now it is reading it as HTML tags.
Updated: 14 Jun 2021 7:38 EDT
Pegasystems Inc.
IN
Can you try using Rich text editor control to show that property.
Sky Solutions LLC
US
The same thing occurs.
IQZ Systems
IN
Hi
The problem might be with the character ( ` ) which is different from single quote character ( ' ).
This appears beside Num 1 in the keyboard. Try to replace all ` characters rather than ' . This could solve the problem.