How can I find an image from a content? I have a method in aspx I am calling this method for remove all html tags like this: Usage.DeleteHtml(Eval("content").ToString())
but I don't want delete img tag from content.. I should find the first image I will show it on my page.. like this:<a href="#"><img src="Usage.FindImage("content")" /></a>
but couldn't write a method for finding image..
my DeleteHtml method:
public static string DeleteHtml(string text)
{
string mystr= Regex.Replace(text, @"<(.|\n)*?>", string.Empty);
return mystr;
}