Is there any way in VB.NET to remove all of the whitespaces between tags in HTML?
Say, I’ve got this:
<tr> <td>
The string I’ve built is an entire HTML document, and it counts everything before those tags as legitimate space, so I need to trim it out. Is there a reg ex or function out there I could use to do this?
Thanks
Depending on the complexity of your document, you probably just need a replace regular expression across the document… Something like:
RegexObj.Replace(‘>[\s\n]*<‘,’><‘)
You can read up about .NET and regular expressions here