I'm trying to remove all whitepace in an HTML-formatted string, except within the actual content.
so I want to get:
- <p> <b>some text</b> </p>
to look like
I've been trying something like:
-
Regex r = new Regex(@"/s<);
-
r.Replace(str, "<");
-
with the idea being to replace all the whitespace immediately preceeding the "<" character. That would be fine for what I'm doing, but no expression using *,+,.,?, etc, is working. The best I'm able to get is removing the first whitespace before an "<" character, but sometimes there's more than one.
Please help, the only Regex expressions I'm coming up with right now are "@$*%!!!"