How c开发者_高级运维an I replace a single quote (') with a double quote (") in a string in C#?
You need to use the correct escape sequence for the quotes symbol, you can find more information about escape sequencies here.
String stringWithSingleQuotes= "src='http://...';";
String withDoubleQuotes = stringWithSingleQuotes.Replace("'","\"");
var abc = "hello the're";
abc = abc.Replace("'","\"");
string str;
str=strtext.Replace('"','\'');
精彩评论