class html_parser { private string text = null; public void setText(string text) { this.text = text; } public string getImg() { var image = "no_image.png"; var s_text = "<img src='"; var e_text = "' alt='"; if (text.IndexOf(s_text) != -1) { int c = (text.IndexOf(s_text) + s_text.Length); image = text.Substring(c, (text.IndexOf(e_text, c) - c)); } return image; } }