If a string has double quotes,
string str = "it is a "text""
how can I find out if the string have " or not.
And how can the double quotes be removed?
If a string has double quotes,
string str = "it is a "text""
how can I find out if the string have " or not.
And how can the double quotes be removed?
To check whether it contains the quote: str.Contains("\"");
To remove the quotes: str.Replace("\"","");
string str = "it is a \"text\"";
string str_without_quotes = str.Replace("\"", "");
Don't bother checking if it contains quotes, just replace them.
Don't forget good old (char)34! It can be used instead of the "\"" and the @"""" too!