如果一个字符串中有双引号,
string str = "it is a "text""
如何判断字符串中是否有双引号。
如何去掉双引号。
检查字符串中是否包含引号: str.Contains("\"");
去除引号: str.Replace("\"","");
string str = "it is a \"text\"";
string str_without_quotes = str.Replace("\"", "");
不必检查它是否包含引号,直接替换即可。
将str = str.Replace("\"", String.Empty);
删除
bool containsQuote = str.Contains("\"");
str.Contains(@"""")
。 - zneak