开发者

How to find all img tags on a string?

I want to find all img tags in a string of text and put a surrounding link - a tag around it. What's the best way to do it? And I want to retrieve the src link and put in the href attribute.

By the way I'm doing it in C# but the way should be similar in ever开发者_JAVA技巧y language. Has anybody done such filtering and replacing? Any advice would be appreciated.


If you're parsing and dealing with raw HTML strings, I would highly recommend using the Html Agility Pack library.


How do you parse an HTML string for image tags to get at the SRC information?

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜