trim double quotations

I can below conversion by Strjing.Trim method .

" TEST "-> “TEST”

I want to conversions as below.

“”“TEST”"" -> “TEST”

Unfortunaly, String.Trim only space trim. How to double quotations trim?

What about ?

Or ReplaceAll.

Replacing ALL triple quotes with a single quote will work in the examples you provided.
result = source.replaceall("""""""","""") which could be done with variables if you don’t like seeing that many quotes together.
I’m not sure if you have examples of embedded triple quotes and how you want that handled.

Thank you. Currently, I use ReplaceAll.
It works well below example.

“”“TEST”"" -> “TEST”

However, below example is wrong:


I want:


If replacing ALL triple quotes with a single quote, escape character, or etc will work.
But, it pollutes the contents of the text.

So, I will write make code trim method with non-space characters. Thank you.

If you define the rules I’m sure someone can help you create a RegEx rule.

For example, it is not clear to me what you want from something like this:

""T ""EST ""2 "" 3"

maybe your needs will need more than one RegEx rule.