C# 怎么把字符串里面所有单引号换成双引号
例如s="asaid'bisadog','sobisnotapig',csaid.";//这里无法修改了//转换Response.Write(s);怎么把s里面的所有单引...
例如
s = "a said 'b is a dog','so b is not a pig',c said.";//这里无法修改了
//转换
Response.Write(s);
怎么把s里面的所有单引号换成双引号表示?
我希望输出的是
a said "b is a dog","so b is not a pig",c said. 展开
s = "a said 'b is a dog','so b is not a pig',c said.";//这里无法修改了
//转换
Response.Write(s);
怎么把s里面的所有单引号换成双引号表示?
我希望输出的是
a said "b is a dog","so b is not a pig",c said. 展开
4个回答
展开全部
你可以使用字符串拼接啊:
s = "a said' "+" ' b is a dog' "+" ',' "+" 'so b is not a pig' "+" ',"+"c said."
s = "a said' "+" ' b is a dog' "+" ',' "+" 'so b is not a pig' "+" ',"+"c said."
展开全部
用转义字符替换。
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询