Donate

Regular Expression In html List Tag Not Working In Multiline String In C#

I have this string:
< li class="MsoNormal" style="color:white;mso-themecolor:background1; mso-margin-top-alt:mso-list:l1 level1 lfo1;tab-stops:list 36.0pt">
and the regex has a lazy quantifier to replace the string above to < li>. Using a simple regex pattern, it won't change the string above to ordinary < li>. The solution would be to add a regex to replace new line characters. Since the string has newline characters.
Regex.Replace(source, @"\n", string.Empty, RegexOptions.IgnoreCase);

Comments

Donate

Popular Posts From This Blog

WPF CRUD Application Using DataGrid, MVVM Pattern, Entity Framework, And C#.NET

How To Insert Or Add Emojis In Microsoft Teams Status Message

Pass GUID As Parameter To Action Using ASP.NET MVC ContribGrid