Reputation: 6477
I am using ASP.NET 4.5 and C#
I want to replace :
<div style="page-break-after:always"><span style="display:none"> </span></div>
in a string with:
<br style="page-break-after: always;" />
I have tried:
//string strContent is a string that contains HTML content
strContent = strContent.Replace("<div style='page-break-after:always'><span style='display:none'> </span></div>", "<br style='page-break-after: always;' />");
But with no success. Obviously I am missing something simple.
Help hugely appreciated.
Upvotes: 0
Views: 206
Reputation: 23103
You mixed up the " and ':
strContent = strContent
.Replace("<div style=\"page-break-after:always\">" +
"<span style=\"display:none\"> </span></div>",
"<br style=\"page-break-after: always;\" />");
Upvotes: 2