Write HTML to string

前端 未结 18 1556
一生所求
一生所求 2020-12-13 00:04

I have code like this. Is there a way to make it easier to write and maintain? Using C# .NET 3.5.

string header(string title)
{
    StringWriter s = new Stri         


        
18条回答
  •  长情又很酷
    2020-12-13 00:27

    The most straight forward way is to use an XmlWriter object. This can be used to produce valid HTML and will take care of all of the nasty escape sequences for you.

    • http://msdn.microsoft.com/en-us/library/system.xml.xmlwriter.aspx

提交回复
热议问题