How Can I strip HTML from Text in .NET?

后端 未结 9 1839
爱一瞬间的悲伤
爱一瞬间的悲伤 2020-12-16 02:20

I have an asp.net web page that has a TinyMCE box. Users can format text and send the HTML to be stored in a database.

On the server, I would like to take strip the h

9条回答
  •  孤街浪徒
    2020-12-16 02:59

    You can use something like this

    string strwithouthtmltag;    
    strwithouthtmltag = Regex.Replace(strWithHTMLTags, "<[^>]*>", string.Empty)
    

提交回复
热议问题