2011-03-04 174 views

回答

36

您需要使用正确的转义序列的报价符号,你可以找到逃生sequencies here更多的信息。

String stringWithSingleQuotes= "src='http://...';"; 
String withDoubleQuotes = stringWithSingleQuotes.Replace("'","\""); 
5
var abc = "hello the're"; 
abc = abc.Replace("'","\""); 
2
string str; 
str=strtext.Replace('"','\''); 
+0

是我们与'你的代码替换“?我认为它应该是相反的。 – Kurkula 2016-07-23 01:27:15

相关问题