Replacing double quotes

Replacing double quotes

  

Hi

I need to convert double quote occurring two times into single occurrence.

Example : ""profession"" as "profession"

I tried using  EncodeHTML to read the double quotes and then replace but its not working. 

Any pointers for the same??I don't want to create function in java script and do the logic.

The below obviously is not working due to literal mismatch but that's what i was trying.

SyntaxEditor Code Snippet

Replace(Text,EncodeHtml(""""),""")




@Tanuj

Try without EncodeHtml.

Solution

Hi Tanuj,

You were trying in the right direction. Within string literals, you need to put two double quotes for every single one. So your replace should look like this:

Replace(Text, """""", """")

(So that's four double quotes representing two double quotes, between the normal string literal double quotes, or six in total, as the second argument, and two double quotes representing a single double quote, between two string literal double quotes, or four in total, as the third argument of Replace.)

Solution

Kilian Hekhuis wrote:

Hi Tanuj,

You were trying in the right direction. Within string literals, you need to put two double quotes for every single one. So your replace should look like this:

Replace(Text, """""", """")

(So that's four double quotes representing two double quotes, between the normal string literal double quotes, or six in total, as the second argument, and two double quotes representing a single double quote, between two string literal double quotes, or four in total, as the third argument of Replace.)

No it didn't worked. It's trying to match four quotes and replace it with two.


Before Replace :

""profession"": ""RN"",
   ""metro"": """",
   ""jobURL"": """","

SyntaxEditor Code Snippet

Replace(HtmlToText.Text,(""""""),(""""))

After Replace :

""profession"": ""RN"",
   ""metro"": "",
   ""jobURL"": "","




Hi Tanuj,

You are being rude, and incorrect. It is not "trying to match four quotes", not "replace it with two". It's replacing two quotes with one. I've attached an example to show that it works.