Converting & to & etc

前端 未结 6 647
佛祖请我去吃肉
佛祖请我去吃肉 2020-12-28 11:54

I want to convert & to &, " to \" etc. Is there a function in c# that could do that without writing all the options manually?<

6条回答
  •  醉酒成梦
    2020-12-28 12:02

    using System.Web; 
    ...
    var html = "this is a sample & string"; 
    var decodedhtml = HttpUtility.HtmlDecode(html);
    

提交回复
热议问题