Unusal double quote

Hi,

I have this string saved in a data table that I ham scraping from a website:

“Christmas Season- “See You Zoom See You Soon” Online English Storytelling”

I am now trying to replace the double quotes around the “See You Zoom See You Soon” but I can’t seem to be able to do that.

I have tried looking for the following either inside a Contains or Replace function:
Chr(34)
\u0022
\u201C
\u201D
\u201E

But nothing seems to be working.

Can anyone help?

Thanks in advance
Raniero

Actually, those double quotes are different than programming double quotes.

Just use copy that double quote and paste in replace.

Example :

varStr.Replace("“",String.empty).Replace("”",String.Empty) 

Just copy paste above as it is and change with your string variable

Hi,
try regex to replace:

output = System.Text.RegularExpressions.Regex.Replace(your_String,"(“|”|\")","")

Preview link: regex101: build, test, and debug regex
image

Thanks for the quick response,

I have tried your approach but it didn’t seem to work:
image
image

Thanks for the quick response, I have tried to use this but it’s giving me a compiler error:
image

Ok, try this:

output = System.Text.RegularExpressions.Regex.Replace(your_String,"[^a-zA-Z -]","")

Preview link: regex101: build, test, and debug regex

image

Hi @Radap

Please try this

Regex Pattern : [\w\d/_$%()&-\]+

And in assign activity store the text

strText - string
mtchColl - matches activity output

strText = string.join(" ",mtchColl.Cast(of match).Select(function(d) d.ToString).toarray)

But it will remove all numbers and other characters than words… Unless he is ok with it…

Yes,
You have right,
possibly it will be better:

output = System.Text.RegularExpressions.Regex.Replace(your_String,"[^[\p{L}|\p{N}|\s|-]","")

Preview link: regex101: build, test, and debug regex

varStr.Replace(ChrW(&H2018), String.Empty).Replace(ChrW(&H2019),String.Empty).Replace(ChrW(&H201C),String.Empty).Replace(ChrW(&H201D), String.Empty)

This will definitely work. Try and let me know

1 Like

Thanks, I have tried this and albeit it might work for the specific string it was excluding other characters present in other strings. ended up using Pravin’s approach at the end.

Thanks for your support, RegEx is something I need to spend some time on.

Raniero

this worked for me.

Thanks a lot for your help

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.