Slavi
(Slav PP)
December 12, 2023, 10:17am
1
“Hi everyone, I have a large text from which I need to remove the sequences “???!!! and !!!???” However, I don’t want to remove all special characters, just these two specific combinations. I’ve been trying to use the Replace function, but I can’t because of the quotation marks.”
“price”:“”,“tooltipContent”:“”}],“description”:“”,“maxLength”:“”,“placeholder”:“”,“cssClass”:“”,“defaultValue”:“”,“conditionalLogic”:“”,“layoutGridColumnSpan”:“???!!!12???!!!”,“enableEnhancedUI”:“???!!!0???!!!”,“calculationFormula”:“”,“tooltipContent”:“”,“imageChoices_enableImages”:“0”},
Desired result:
“price”:“”,“tooltipContent”:“”}],“description”:“”,“maxLength”:“”,“placeholder”:“”,“cssClass”:“”,“defaultValue”:“”,“conditionalLogic”:“”,“layoutGridColumnSpan”:12,“enableEnhancedUI”:0,“calculationFormula”:“”,“tooltipContent”:“”,“imageChoices_enableImages”:“0”},
Thanks!
Anil_G
(Anil Gorthi)
December 12, 2023, 10:21am
2
@Slavi
please use replace like this str.Replace("""???!!!","").Replace("???!!!""","")
cheers
ppr
(Peter Preuss)
December 12, 2023, 10:24am
3
give a try at
strPattern = "(""\?\?\?!!!|\?\?\?!!!"")"
strCleansed =
System.Text.Regularexpressions.Regex.Replace(YourTextVar, strPattern, "")
Hi @Slavi
Assign cleanedText = System.Text.RegularExpressions.Regex.Replace(yourInputText, "\?*\!*", "")
Slavi
(Slav PP)
December 12, 2023, 10:33am
5
Hi there, unfortunately it is not really working out. Here is the error message:
@Slavi
Just now Modified,Sorry for mistake
ppr
(Peter Preuss)
December 12, 2023, 10:35am
7
it is about the ? which we would ecape with \ within the pattern as shown here
Slavi
(Slav PP)
December 12, 2023, 10:36am
8
I am getting the same error message as in previous post:
Slavi
(Slav PP)
December 12, 2023, 10:38am
9
pravallikapaluri:
Just now Modified
no worries, but I am not really sure what should I do with Just now Modifier?
@Slavi
Check with this
Assign cleanedText = System.Text.RegularExpressions.Regex.Replace(yourInputText, "\?*\!*", "")
ppr
(Peter Preuss)
December 12, 2023, 10:42am
11
we crosschecked within immediate panel (kindly note a " is visualized by ")
and as shown above it was working
Slavi
(Slav PP)
December 12, 2023, 10:43am
12
this one works well thanks!
1 Like
system
(system)
Closed
December 15, 2023, 10:44am
13
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.