开发者

how to remove blank <p>&nbsp;</p> tags at end of paragraph

开发者 https://www.devze.com 2023-01-30 02:41 出处:网络
the description which is comming from database has n开发者_开发问答umber of<p>&nbsp;</p> these tags

the description which is comming from database has n开发者_开发问答umber of <p>&nbsp;</p> these tags so my page is occuyping large amount of blank space. I want to remove all those blank

tag which are coming at end of page

How to do this?


you can use like this

string[] tags = {"&nbsp;","<p>","</p>","<br>"};
    string str1 = "this is best<br> &nbsp;&nbsp; tag <p>&nbsp;&nbsp;</p> <p>&nbsp;in the asp.net</p>";
    foreach (var tag in tags)
    {
        str1 = str1.Replace(tag, "");
    }


There is a similar issue with Tiny MCE in the Umbraco CMS. A work around can be found here: http://our.umbraco.org/forum/using/ui-questions/6266-Empty-p-tag-when-inserting-macro-into-text-editor - tho this is for C# but may help you in the right direction

0

精彩评论

暂无评论...
验证码 换一张
取 消