如何在 C# 中将字符串中的单引号 (') 替换为双引号 (")?
最佳答案
您需要为引号使用正确的转义序列,您可以找到有关转义序列的更多信息 here .
String stringWithSingleQuotes= "src='http://...';";
String withDoubleQuotes = stringWithSingleQuotes.Replace("'","\"");
关于c# - 在 C# 中,字符串将单引号替换为双引号,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5189269/