html entity encode text only, not html tag

前端 未结 2 1191
一整个雨季
一整个雨季 2021-01-21 05:12

i have a string that contains a bunch of html. i want to html-encode the text within the html tags but not the tags themselves. is there an easy way to do this in asp.net c# 3.5

2条回答
  •  失恋的感觉
    2021-01-21 05:20

    if you need a bunch of functions use the htmlagilitypack. if you just need urls or something in specific tags a selfwritten parser would be more efficient

提交回复
热议问题