-1

So, what I need to do replace this string " ' " (whitout space) for ', and the .Replace() is the ovios way, but when I try to do

  • txtAux = txtAux.Replace(" "'" " , "");

the 3rd " didnt represent as I expected. I try to do something like I do sometimes on .Split...

  • txtAux = txtAux.Replace(new string { " "'" "},new string {"'"}); Also I try to Regex, but regex im not shure to use Regular Expression.

I have this:'"' CHARSET '"'|''' CHARSET ''' I need this:"CHARSET"|'CHARSET'

Alfa Rojo
  • 165
  • 8

1 Answers1

1

" is a special character, part of the language syntax, which helps you define string literals. So any " is either begin or the end of the string unless it is escaped.

Escaping characters is a mechanism to tell that you want to use a special character just as a symbol, not the part of the language syntax.

To create a string containing " you escape it in a string literal with a backslash like this: "\"".

Hope this helps.

Dmitrii Abramov
  • 106
  • 1
  • 5