how to convert the html tags and get a message in string
how to convert the html tags to the msg bodg in mail function.
i.e i have
Company Name: BPL
Industry Type:
开发者_如何学Pythoni have got the string as
datatable dt=new datatable();
string msg= dt.rows[i]["Message"].tostring();
i need to convert this html tags to the exact message;
if (boolcheck)
{
msg.Body = ????????? wat to use over here.... how to remove the html tags and get the exact message
}
pls help??????????/
This should help you.
public string Strip(string text)
{
return Regex.Replace(text, @”<(.|\n)*?>”, string.Empty);
}
to remove a perticular tag try this one http://urenjoy.blogspot.com/2008/10/remove-html-tags-from-string.html
Use Regular expressions
Regex.Replace(msg, "<.*?>", string.Empty);
精彩评论