C# Beginner: Delete ALL between two characters in a string (Regex?)

前端 未结 2 1498
再見小時候
再見小時候 2021-01-19 09:49

i have a string with an html code. i want to remove all html tags. so all characters between < and >.

This is my code snipped:

WebClient wClient          


        
2条回答
  •  心在旅途
    2021-01-19 10:14

    Try this:

    txtSourceCodeFormatted.Text = Regex.Replace(SourceCode, "<.*?>", string.Empty);
    

    But, as others have mentioned, handle with care.

提交回复
热议问题