I have a program that I am writing that should cut html tags from a string. I am trying to replace all lines starting with "<" and ending with ">". This (obviously, because I'm asking about it here) is not working yet. Here is what I tried:
StrippedContent = Regex.Replace(StrippedContent, "\<.*\>", "")
This simply returns what seems like a random part of the original string. I also tried
For Each StringMatch As Match In Regex.Matches(StrippedContent, "\<.*\>") StrippedContent = StrippedContent.Replace(StringMatch.Value, "") Next
That did the same (returns what seems like a random part of the original string). Is there a better way to do this? For the better, I mean the way that works.
source share