Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to specify the " character

Tags:

html

c#

winforms

I am trying to use string.Remove to remove all occurrences of " in my html, but I forgot how to tell it to use " as a character instead of its usual meaning.

Thanks.

like image 418
TheGateKeeper Avatar asked Dec 06 '22 15:12

TheGateKeeper


2 Answers

You have to escape it with \, so write \" instead of " where you mean ".

string.Remove removed part of the string based on start index, and length, so that is not what you are actually looking for, but replace will help you to get rid of all "'s.

myString.Replace("\"","")
like image 194
Øyvind Bråthen Avatar answered Dec 23 '22 12:12

Øyvind Bråthen


\"

Simply escape the quotes with a backslash.

like image 33
aaroncatlin Avatar answered Dec 23 '22 11:12

aaroncatlin