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

c#, regex, windows

Solution

Try this:

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

But, as others have mentioned, handle with care.

Problem

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 = new WebClient(); SourceCode = wClient.DownloadString( txtSourceURL.Text ); txtSourceCode.Text = SourceCode; //remove here all between "<" and ">" txtSourceCodeFormatted.Text = SourceCode; ``` hope somebody can help me

Original source

Related problems