开发者

Changing html with Regex in C#

I've got source string like

<p>blablabla</p>
<p><img style="float: left;" src="../Content/attachments/455dd178-db28-4856-85e8-c65c8e6b04df_312540909.jpg" alt="455dd178-db28-4856-85e8-c65c8e6b04df_312540909.jpg" />blablabla</p>
<p><img style="float: right;" src="../Content/attachments/dec0f850-2921-4bf7-87b8-d2410e04a841_image001.gif" alt="dec0f850-2921-4bf7-87b8-d2410e04a841_image001.gif" width="100"开发者_开发技巧 /></p>

For each img element I need to remove alt attribute, and replace src elements with srcFileName.Substring(37).

Can't figure out the regex needed. Please help.


Had to use Html Agility Pack for this

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜